use of io.trino.server.security.oauth2.ScribeJavaOAuth2Client.DynamicCallbackOAuth2Service in project trino by trinodb.
the class TestDynamicCallbackOAuth2Service method testMultipleScopes.
@Test
public void testMultipleScopes() throws Exception {
DynamicCallbackOAuth2Service service = new DynamicCallbackOAuth2Service(new OAuth2Config().setIssuer(hydraUrl).setAuthUrl(hydraUrl + "/oauth2/auth").setTokenUrl(hydraUrl + "/oauth2/token").setJwksUrl(hydraUrl + "/.well-known/jwks.json").setClientId(CLIENT_ID).setClientSecret(CLIENT_SECRET).setScopes("openid,offline"), httpClient);
OAuth2AccessToken token = service.getAccessTokenClientCredentialsGrant();
Claims claims = newJwtParserBuilder().setSigningKeyResolver(signingKeyResolver).build().parseClaimsJws(token.getAccessToken()).getBody();
assertThat(claims.get("scp", List.class)).containsExactlyInAnyOrder("openid", "offline");
}
Aggregations