Authorization
Authorization helpers for protected resources
Use auth helpers for authorization code exchange, token validation, and related login token flows on the Scalekit client.
These methods sit next to session management—use them when implementing hosted login callbacks and token checks.
getAuthorizationUrl
Section titled “getAuthorizationUrl”#asyncgetAuthorizationUrl
Runs getAuthorizationUrl and returns the result.
Redirect uri.
Optional request settings.
The response payload for this operation.
import com.scalekit.internal.http.AuthorizationUrlOptions;import java.net.URL;
AuthorizationUrlOptions options = new AuthorizationUrlOptions();options.setOrganizationId("org_123");options.setState("random-state-value");
URL authUrl = scalekitClient.authentication().getAuthorizationUrl( "https://yourapp.com/auth/callback", options);validateAccessToken
Section titled “validateAccessToken”#asyncvalidateAccessToken
Runs validateAccessToken and returns the result.
Jwt.
boolean
boolean ok = scalekitClient.authentication().validateAccessToken("<access_token_jwt>");generateClientToken
Section titled “generateClientToken”#asyncgenerateClientToken
Runs generateClientToken and returns the result.
Client ID.
Client secret.
String.
getClientAccessToken
Section titled “getClientAccessToken”#asyncgetClientAccessToken
Runs getClientAccessToken and returns the result.
The response payload for this operation.
String token = scalekitClient.authentication().getClientAccessToken();authenticateWithCode
Section titled “authenticateWithCode”#asyncauthenticateWithCode
Runs authenticateWithCode and returns the result.
Authorization code.
Redirect uri.
Optional request settings.
Authentication.
import com.scalekit.internal.http.AuthenticationOptions;import com.scalekit.internal.http.AuthenticationResponse;
AuthenticationResponse result = scalekitClient.authentication().authenticateWithCode( "<code>", "https://yourapp.com/auth/callback", new AuthenticationOptions());
String accessToken = result.getAccessToken();