/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param credential * The client assertion to use for token acquisition. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final ClientAssertion credential, final AuthenticationCallback callback) { return acquireTokenByAuthorizationCode(authorizationCode, redirectUri, credential, (String) null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param credential * object representing Private Key to use for token acquisition. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. * @throws AuthenticationException * thrown if {@link AsymmetricKeyCredential} fails to sign the * JWT token. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final AsymmetricKeyCredential credential, final AuthenticationCallback callback) throws AuthenticationException { return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, credential, null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param clientAssertion * The client assertion to use for client authentication. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final ClientAssertion clientAssertion, final AuthenticationCallback callback) { return acquireTokenByAuthorizationCode(authorizationCode, redirectUri, clientAssertion, (String) null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param credential * object representing Private Key to use for token acquisition. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. * @throws AuthenticationException * thrown if {@link AsymmetricKeyCredential} fails to sign the * JWT token. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final AsymmetricKeyCredential credential, final AuthenticationCallback callback) throws AuthenticationException { return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, credential, null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param clientAssertion * The client assertion to use for client authentication. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final ClientAssertion clientAssertion, final AuthenticationCallback callback) { return acquireTokenByAuthorizationCode(authorizationCode, redirectUri, clientAssertion, (String) null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param credential * object representing Private Key to use for token acquisition. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. * @throws AuthenticationException * thrown if {@link AsymmetricKeyCredential} fails to sign the * JWT token. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final AsymmetricKeyCredential credential, final AuthenticationCallback callback) throws AuthenticationException { return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, credential, null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param credential * The client credential to use for token acquisition. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final ClientCredential credential, final AuthenticationCallback callback) { this.validateAuthCodeRequestInput(authorizationCode, redirectUri, credential, null); return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, credential, null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param credential * The client credential to use for token acquisition. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final ClientCredential credential, final AuthenticationCallback callback) { this.validateAuthCodeRequestInput(authorizationCode, redirectUri, credential, null); return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, credential, null, callback); }
/** * Acquires security token from the authority using an authorization code * previously received. * * @param authorizationCode * The authorization code received from service authorization * endpoint. * @param redirectUri * The redirect address used for obtaining authorization code. * @param credential * The client credential to use for token acquisition. * @param callback * optional callback object for non-blocking execution. * @return A {@link Future} object representing the * {@link AuthenticationResult} of the call. It contains Access * Token, Refresh Token and the Access Token's expiration time. */ public Future<AuthenticationResult> acquireTokenByAuthorizationCode( final String authorizationCode, final URI redirectUri, final ClientCredential credential, final AuthenticationCallback callback) { this.validateAuthCodeRequestInput(authorizationCode, redirectUri, credential, null); return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, credential, null, callback); }
public Future<AuthenticationResult> get(AuthenticationContext context, String resource) { return context .acquireTokenByAuthorizationCode(response.getCode(), resource, azureLoginConfiguration.getClientId(), URI.create(azureLoginConfiguration.getRedirectUrl()), null); } }
this.validateAuthCodeRequestInput(authorizationCode, redirectUri, credential, resource); return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, JwtHelper .buildJwt(credential, this.authenticationAuthority
this.validateAuthCodeRequestInput(authorizationCode, redirectUri, credential, resource); return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, JwtHelper .buildJwt(credential, this.authenticationAuthority
this.validateAuthCodeRequestInput(authorizationCode, redirectUri, credential, resource); return this.acquireTokenByAuthorizationCode(authorizationCode, redirectUri, JwtHelper .buildJwt(credential, this.authenticationAuthority
return context.acquireTokenByAuthorizationCode( authorizationCode, new URI(redirectUrl), resource, null).get(); } else if (applicationCredentials.clientCertificate() != null && applicationCredentials.clientCertificatePassword() != null) { return context.acquireTokenByAuthorizationCode( authorizationCode, new URI(redirectUrl), null).get(); } else if (applicationCredentials.clientCertificate() != null) { return context.acquireTokenByAuthorizationCode( authorizationCode, new URI(redirectUrl),
URI url = new URI(context.getCallbackUrl()); ClientCredential clientCredt = new ClientCredential(settings.clientId(), settings.clientSecret()); Future<AuthenticationResult> future = authContext.acquireTokenByAuthorizationCode( oAuthVerifier, url, clientCredt, settings.getGraphURL(), null); result = future.get();