private void validateOnBehalfOfRequestInput(final String resource, final UserAssertion userAssertion, final Object clientCredential, final boolean validateResource) { if (userAssertion == null) { throw new IllegalArgumentException("userAssertion is null"); } this.validateInput(resource, clientCredential, validateResource); } }
private void validateOnBehalfOfRequestInput(final String resource, final UserAssertion userAssertion, final Object clientCredential, final boolean validateResource) { if (userAssertion == null) { throw new IllegalArgumentException("userAssertion is null"); } this.validateInput(resource, clientCredential, validateResource); } }
private void validateAuthCodeRequestInput(final String authorizationCode, final URI redirectUri, final Object clientCredential, final String resource) { if (StringHelper.isBlank(authorizationCode)) { throw new IllegalArgumentException( "authorization code is null or empty"); } if (redirectUri == null) { throw new IllegalArgumentException("redirect uri is null"); } this.validateInput(resource, clientCredential, false); }
private void validateAuthCodeRequestInput(final String authorizationCode, final URI redirectUri, final Object clientCredential, final String resource) { if (StringHelper.isBlank(authorizationCode)) { throw new IllegalArgumentException( "authorization code is null or empty"); } if (redirectUri == null) { throw new IllegalArgumentException("redirect uri is null"); } this.validateInput(resource, clientCredential, false); }
private void validateAuthCodeRequestInput(final String authorizationCode, final URI redirectUri, final Object credential, final String resource) { if (StringHelper.isBlank(authorizationCode)) { throw new IllegalArgumentException( "authorization code is null or empty"); } if (redirectUri == null) { throw new IllegalArgumentException("redirect uri is null"); } this.validateInput(resource, credential, false); } }
private void validateRefreshTokenRequestInput(final String refreshToken, final String clientId, final Object credential) { if (StringHelper.isBlank(refreshToken)) { throw new IllegalArgumentException("refreshToken is null or empty"); } if (StringHelper.isBlank(clientId)) { throw new IllegalArgumentException("clientId is null or empty"); } this.validateInput(null, credential, false); }
private void validateRefreshTokenRequestInput(final String refreshToken, final String clientId, final Object credential) { if (StringHelper.isBlank(refreshToken)) { throw new IllegalArgumentException("refreshToken is null or empty"); } if (StringHelper.isBlank(clientId)) { throw new IllegalArgumentException("clientId is null or empty"); } this.validateInput(null, credential, false); }
private void validateRefreshTokenRequestInput(final String refreshToken, final String clientId, final Object credential) { if (StringHelper.isBlank(refreshToken)) { throw new IllegalArgumentException("refreshToken is null or empty"); } if (StringHelper.isBlank(clientId)) { throw new IllegalArgumentException("clientId is null or empty"); } this.validateInput(null, credential, false); }
private void validateDeviceCodeRequestInput(final DeviceCode deviceCode, final Object credential, final String resource) { if (StringHelper.isBlank(deviceCode.getDeviceCode())) { throw new IllegalArgumentException("device code is null or empty"); } if (StringHelper.isBlank(deviceCode.getCorrelationId())) { throw new IllegalArgumentException("correlation id in device code is null or empty"); } this.validateInput(resource, credential, true); }
private void validateDeviceCodeRequestInput(final DeviceCode deviceCode, final Object credential, final String resource) { if (StringHelper.isBlank(deviceCode.getDeviceCode())) { throw new IllegalArgumentException("device code is null or empty"); } if (StringHelper.isBlank(deviceCode.getCorrelationId())) { throw new IllegalArgumentException("correlation id in device code is null or empty"); } this.validateInput(resource, credential, true); }
/** * Acquires security token from the authority. * * @param resource * Identifier of the target resource that is the recipient of the * requested token. * @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 and the Access Token's expiration time. Refresh Token * property will be null for this overload. */ public Future<AuthenticationResult> acquireToken(final String resource, final ClientAssertion clientAssertion, final AuthenticationCallback callback) { this.validateInput(resource, clientAssertion, true); final ClientAuthentication clientAuth = createClientAuthFromClientAssertion(clientAssertion); final AdalOAuthAuthorizationGrant authGrant = new AdalOAuthAuthorizationGrant( new ClientCredentialsGrant(), resource); return this.acquireToken(authGrant, clientAuth, callback); }
/** * Acquires security token from the authority. * * @param resource * Identifier of the target resource that is the recipient of the * requested token. * @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 and the Access Token's expiration time. Refresh Token * property will be null for this overload. */ public Future<AuthenticationResult> acquireToken(final String resource, final ClientAssertion credential, final AuthenticationCallback callback) { this.validateInput(resource, credential, true); final ClientAuthentication clientAuth = createClientAuthFromClientAssertion(credential); final AdalAuthorizatonGrant authGrant = new AdalAuthorizatonGrant( new ClientCredentialsGrant(), resource); return this.acquireToken(authGrant, clientAuth, callback); }
/** * Acquires security token from the authority. * * @param resource * Identifier of the target resource that is the recipient of the * requested token. * @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 and the Access Token's expiration time. Refresh Token * property will be null for this overload. */ public Future<AuthenticationResult> acquireToken(final String resource, final ClientAssertion clientAssertion, final AuthenticationCallback callback) { this.validateInput(resource, clientAssertion, true); final ClientAuthentication clientAuth = createClientAuthFromClientAssertion(clientAssertion); final AdalOAuthAuthorizationGrant authGrant = new AdalOAuthAuthorizationGrant( new ClientCredentialsGrant(), resource); return this.acquireToken(authGrant, clientAuth, callback); }
/** * Acquires security token from the authority. * * @param resource * Identifier of the target resource that is the recipient of the * requested token. * @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 and the Access Token's expiration time. Refresh Token * property will be null for this overload. */ public Future<AuthenticationResult> acquireToken(final String resource, final ClientCredential credential, final AuthenticationCallback callback) { this.validateInput(resource, credential, true); final ClientAuthentication clientAuth = new ClientSecretPost( new ClientID(credential.getClientId()), new Secret( credential.getClientSecret())); final AdalOAuthAuthorizationGrant authGrant = new AdalOAuthAuthorizationGrant( new ClientCredentialsGrant(), resource); return this.acquireToken(authGrant, clientAuth, callback); }
/** * Acquires security token from the authority. * * @param resource * Identifier of the target resource that is the recipient of the * requested token. * @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 and the Access Token's expiration time. Refresh Token * property will be null for this overload. */ public Future<AuthenticationResult> acquireToken(final String resource, final ClientCredential credential, final AuthenticationCallback callback) { this.validateInput(resource, credential, true); final ClientAuthentication clientAuth = new ClientSecretPost( new ClientID(credential.getClientId()), new Secret( credential.getClientSecret())); final AdalOAuthAuthorizationGrant authGrant = new AdalOAuthAuthorizationGrant( new ClientCredentialsGrant(), resource); return this.acquireToken(authGrant, clientAuth, callback); }
/** * Acquires security token from the authority. * * @param resource * Identifier of the target resource that is the recipient of the * requested token. * @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 and the Access Token's expiration time. Refresh Token * property will be null for this overload. */ public Future<AuthenticationResult> acquireToken(final String resource, final ClientCredential credential, final AuthenticationCallback callback) { this.validateInput(resource, credential, true); final ClientAuthentication clientAuth = new ClientSecretPost( new ClientID(credential.getClientId()), new Secret( credential.getClientSecret())); final AdalAuthorizatonGrant authGrant = new AdalAuthorizatonGrant( new ClientCredentialsGrant(), resource); return this.acquireToken(authGrant, clientAuth, callback); }