public interface AuthorizationService
| Modifier and Type | Method and Description |
|---|---|
AuthorizationFlowResult |
completeAuthorizationFlow(String clientId,
String redirectUri,
String code)
Completes authorization flow and returns
Authorization if successful |
Optional<Authorization> |
getAuthorization(String authorizationCode)
fetches the Authorization object for the given code
|
boolean |
isPkceCodeVerifierValidAgainstAuthorization(String codeVerifier,
String authorizationCode)
Checks if the provided code verifier produces the expected code challenge for the authorization associated
with the provided authorization code.
|
boolean |
isPkceEnabledForAuthorization(String authorizationCode)
Checks if PKCE is enabled for the given authorization request.
|
void |
removeExpiredAuthorizations(Duration expirationPeriod)
Remove expired authorizations after a expiration period
|
String |
startAuthorizationFlow(String clientId,
String redirectUri,
Scope scope,
CodeChallengeMethod codeChallengeMethod,
String codeChallenge)
Creates an authorization request
|
String startAuthorizationFlow(@Nonnull String clientId, @Nonnull String redirectUri, @Nonnull Scope scope, CodeChallengeMethod codeChallengeMethod, String codeChallenge)
clientId - used for this authorization requestredirectUri - the redirect uri verified when getting a tokenscope - scope used in authorization flowcodeChallengeMethod - determines how the code verifier should be validated during PKCE. Passing `null` will disable PKCE for the flow.codeChallenge - the code challenge produced by transforming the legitimate code verifier (based on the code challenge method). Can be null if PKCE disabled.AuthorizationFlowResult completeAuthorizationFlow(@Nonnull String clientId, @Nonnull String redirectUri, @Nonnull String code)
Authorization if successfulclientId - verify same client id usedredirectUri - verify the same redirect uri as at the start of the flowcode - verify the same code as generated at the start of the flowAuthorizationFlowResult verification resultOptional<Authorization> getAuthorization(@Nonnull String authorizationCode)
authorizationCode - authorization code to lookupboolean isPkceEnabledForAuthorization(@Nonnull String authorizationCode)
authorizationCode - the code provided by the authorization serverboolean isPkceCodeVerifierValidAgainstAuthorization(@Nonnull String codeVerifier, @Nonnull String authorizationCode)
codeVerifier - the code verifier to checkauthorizationCode - the authorization codeCopyright © 2020–2023 Atlassian. All rights reserved.