All URIs are relative to https://auth-service-latest.onrender.com/auth
| Method | HTTP request | Description |
|---|---|---|
| clientGet | GET /client | Get client ID and secret |
| loginClientPost | POST /login/client | Logs in a user using client ID and secret |
| regenerateClientCredentialsPost | POST /regenerate-client-credentials | Regenerate client credentials |
| registerPost | POST /register | Registers a new user |
ClientGet200Response clientGet(username, password)
Get client ID and secret
Returns the client ID and client secret of the user associated with the provided username and password.
// Import classes:
import authservice.client.ApiClient;
import authservice.client.ApiException;
import authservice.client.Configuration;
import authservice.client.models.*;
import authservice.client.api.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://auth-service-latest.onrender.com/auth");
DefaultApi apiInstance = new DefaultApi(defaultClient);
String username = "johndoe"; // String | User's username
String password = "password123"; // String | User's password
try {
ClientGet200Response result = apiInstance.clientGet(username, password);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#clientGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | String | User's username | |
| password | String | User's password |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Client ID and client secret retrieved successfully | - |
| 401 | Unauthorized (invalid credentials) | - |
| 500 | Internal server error | - |
LoginClientPost200Response loginClientPost(clientId, clientSecret)
Logs in a user using client ID and secret
Authenticates a user with the provided client ID and secret. Returns a JWT token, token type (Bearer), and expiry time in seconds.
// Import classes:
import authservice.client.ApiClient;
import authservice.client.ApiException;
import authservice.client.Configuration;
import authservice.client.models.*;
import authservice.client.api.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://auth-service-latest.onrender.com/auth");
DefaultApi apiInstance = new DefaultApi(defaultClient);
String clientId = "abc123-xyz456"; // String | User's client ID
String clientSecret = "def789-ghi012"; // String | User's client secret
try {
LoginClientPost200Response result = apiInstance.loginClientPost(clientId, clientSecret);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#loginClientPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| clientId | String | User's client ID | |
| clientSecret | String | User's client secret |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Login successful | - |
| 401 | Unauthorized (invalid client credentials) | - |
| 500 | Internal server error | - |
RegenerateClientCredentialsPost200Response regenerateClientCredentialsPost(username, password)
Regenerate client credentials
Regenerates the client ID and client secret of the user associated with the provided username and password. Returns the new client ID and client secret in the response.
// Import classes:
import authservice.client.ApiClient;
import authservice.client.ApiException;
import authservice.client.Configuration;
import authservice.client.models.*;
import authservice.client.api.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://auth-service-latest.onrender.com/auth");
DefaultApi apiInstance = new DefaultApi(defaultClient);
String username = "johndoe"; // String | User's username
String password = "password123"; // String | User's password
try {
RegenerateClientCredentialsPost200Response result = apiInstance.regenerateClientCredentialsPost(username, password);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#regenerateClientCredentialsPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | String | User's username | |
| password | String | User's password |
RegenerateClientCredentialsPost200Response
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Client credentials regenerated successfully | - |
| 401 | Unauthorized (invalid credentials) | - |
| 500 | Internal server error | - |
RegisterPost201Response registerPost(username, password, role)
Registers a new user
Creates a new user with the provided username, password, and role. Returns the generated client ID and client secret in the response.
// Import classes:
import authservice.client.ApiClient;
import authservice.client.ApiException;
import authservice.client.Configuration;
import authservice.client.models.*;
import authservice.client.api.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://auth-service-latest.onrender.com/auth");
DefaultApi apiInstance = new DefaultApi(defaultClient);
String username = "johndoe"; // String | Unique username for the user
String password = "password123"; // String | User's password
String role = "user"; // String |
try {
RegisterPost201Response result = apiInstance.registerPost(username, password, role);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#registerPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| username | String | Unique username for the user | |
| password | String | User's password | |
| role | String | [default to user] [enum: user, admin, moderator, guest, superadmin] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | User registered successfully | - |
| 400 | Bad request (e.g., username already taken) | - |
| 500 | Internal server error | - |