use of io.vertx.ext.auth.oauth2.impl.OAuth2AuthProviderImpl in project vertx-auth by vert-x3.
the class Oauth2TokenTest method testNullScope.
@Test
public void testNullScope() throws Exception {
super.setUp();
oauth2 = KeycloakAuth.create(vertx, OAuth2FlowType.AUTH_CODE, keycloakConfig);
JsonObject json = new JsonObject("{\n" + " \"access_token\":\"xyz\",\n" + " \"expires_in\":60,\n" + " \"token_type\":\"bearer\",\n" + " \"not-before-policy\":0,\n" + " \"scope\":null\n" + "}");
try {
OAuth2TokenImpl token = new OAuth2TokenImpl((OAuth2AuthProviderImpl) oauth2, json);
} catch (RuntimeException e) {
fail();
}
}
use of io.vertx.ext.auth.oauth2.impl.OAuth2AuthProviderImpl in project vertx-auth by vert-x3.
the class Oauth2TokenTest method keycloakTest.
@Test
public void keycloakTest() throws Exception {
super.setUp();
oauth2 = KeycloakAuth.create(vertx, OAuth2FlowType.AUTH_CODE, keycloakConfig);
OAuth2TokenImpl token = new OAuth2TokenImpl((OAuth2AuthProviderImpl) oauth2, keycloakToken);
assertNotNull(token.opaqueAccessToken());
assertNotNull(token.opaqueRefreshToken());
assertNull(token.accessToken());
// trust it
token.setTrustJWT(true);
assertNotNull(token.accessToken());
}
Aggregations