-
Notifications
You must be signed in to change notification settings - Fork 149
Acquiring Tokens with Authorization codes
Santiago Gonzalez edited this page May 23, 2019
·
2 revisions
The Authorization Code flow is suitable when the application requires the user's interaction with the Azure AD STS during authentication. One such case is when users login to Web applications (web sites) using Open Id connect. The web application receives an authorization code which it can redeem to acquire a token for Web APIs.
Requests for authorization codes are delegated to the developer. To understand how to request an authorization code, see Authorization code flow.
PublicClientApplication pca = new PublicClientApplication.Builder(APP_ID)
.authority(AUTHORITY)
.build();
IAuthenticationResult result = pca.acquireToken(AuthorizationCodeParameters
.builder(authCode, new URI(REPLY_URL))
.scopes(scope)
.build())
.get();
- Home
- Why use MSAL4J
- Register your app with AAD
- Scenarios
- Client Applications
- Acquiring tokens
- IAuthenticationResult
- Calling a protected API