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();updateLoginUserDetails
Section titled “updateLoginUserDetails”#updateLoginUserDetails
Updates the user details for an in-progress login request, for example after collecting additional profile information, or marking the login as failed with User.newBuilder().setLoginFailed(true).
The connection ID the login request belongs to.
The login request ID being updated.
The user details to apply to the login request.
Result carrying the auth request ID (result.getAuthRequestId()), which you can use to look up the user’s authentication journey in the auth logs.
import com.scalekit.grpc.scalekit.v1.auth.User;import com.scalekit.internal.http.UpdateLoginUserDetailsResult;
User user = User.newBuilder() .setSub("unique_user_id_456") .setEmail("john.doe@company.com") .build();
UpdateLoginUserDetailsResult result = scalekitClient.login().updateLoginUserDetails( "conn_abc123", "login_xyz789", user);
// The auth request ID can be used to look up the authentication journey via auth logs.String authRequestId = result.getAuthRequestId();