Acquire tokens with authorization codes
The Authorization Code flow is suitable when the application requires the user's interaction with the Microsoft Entra STS during authentication. One such case is when users login to Web applications (web sites) using OpenID 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. To construct the authorization code URL where the user will input their credentials, you can use the authorization code URL builder
Code snippet
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();
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour