public static Token requestWithClientSecretJwt(final String tokenUrl, final String umaClientId, final String umaClientSecret, AuthenticationMethod authenticationMethod, SignatureAlgorithm signatureAlgorithm, String audience, UmaScopeType scopeType, String... scopeArray) throws Exception { String scope = scopeType.getValue(); if (scopeArray != null && scopeArray.length > 0) { for (String s : scopeArray) { scope = scope + " " + s; } } TokenRequest request = new TokenRequest(GrantType.CLIENT_CREDENTIALS); request.setAuthUsername(umaClientId); request.setAuthPassword(umaClientSecret); request.setScope(scope); request.setAuthenticationMethod(authenticationMethod); request.setAlgorithm(signatureAlgorithm); request.setAudience(audience); return request(tokenUrl, request); }
tokenRequest.setAuthUsername(clientId); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setAlgorithm(algorithm); tokenRequest.setKeyId(tmpKeyId); tokenRequest.setAudience(tokenUrl);
tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setAlgorithm(SignatureAlgorithm.HS384); tokenRequest.setAudience(audience);
tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setAlgorithm(SignatureAlgorithm.HS512); tokenRequest.setAudience(audience);
tokenRequest.setAuthPassword(clientSecret5); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.ES384); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAlgorithm(SignatureAlgorithm.RS256); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAlgorithm(SignatureAlgorithm.RS256); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthPassword(clientSecret5); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.RS384); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthPassword(clientSecret6); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.RS512); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthPassword(clientSecret2); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.ES384); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthPassword(clientSecret3); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.ES512); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthPassword(clientSecret4); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.ES256); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAlgorithm(SignatureAlgorithm.RS256); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthPassword(clientSecret2); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.RS384); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthPassword(clientSecret6); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.ES512); tokenRequest.setKeyId(keyId); tokenRequest.setCryptoProvider(cryptoProvider);
tokenRequest.setAuthUsername(umaAatClientId); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setAlgorithm(cryptoProvider.getSignatureAlgorithm(keyId)); tokenRequest.setKeyId(keyId); tokenRequest.setAudience(umaMetadata.getTokenEndpoint());
tokenRequest.setAuthPassword("INVALID_CLIENT_SECRET"); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.HS384); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setAudience(tokenEndpoint);
tokenRequest.setAuthPassword("INVALID_CLIENT_SECRET"); tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.HS256); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setAudience(tokenEndpoint);
tokenRequest.setAuthUsername(clientId); tokenRequest.setAuthenticationMethod(AuthenticationMethod.PRIVATE_KEY_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.RS384); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setKeyId("RS384SIG_INVALID_KEYID");
tokenRequest.setAuthUsername(clientId); tokenRequest.setAuthenticationMethod(AuthenticationMethod.PRIVATE_KEY_JWT); tokenRequest.setAlgorithm(SignatureAlgorithm.ES384); tokenRequest.setCryptoProvider(cryptoProvider); tokenRequest.setKeyId("ES384SIG_INVALID_KEYID");