use of org.keycloak.broker.oidc.OAuth2IdentityProviderConfig in project keycloak by keycloak.
the class AbstractOAuth2IdentityProviderTest method getConfig.
private OAuth2IdentityProviderConfig getConfig(final String autorizationUrl, final String defaultScope, final String clientId, final Boolean isLoginHint) {
IdentityProviderModel model = new IdentityProviderModel();
OAuth2IdentityProviderConfig config = new OAuth2IdentityProviderConfig(model);
config.setAuthorizationUrl(autorizationUrl);
config.setDefaultScope(defaultScope);
config.setClientId(clientId);
config.setLoginHint(isLoginHint);
return config;
}
use of org.keycloak.broker.oidc.OAuth2IdentityProviderConfig in project keycloak by keycloak.
the class AbstractOAuth2IdentityProviderTest method constructor_defaultScopeHandling.
@Test
public void constructor_defaultScopeHandling() {
TestProvider tested = getTested();
// default scope is set from the provider if not provided in the configuration
Assert.assertEquals(tested.getDefaultScopes(), tested.getConfig().getDefaultScope());
// default scope is preserved if provided in the configuration
IdentityProviderModel model = new IdentityProviderModel();
OAuth2IdentityProviderConfig config = new OAuth2IdentityProviderConfig(model);
config.setDefaultScope("myscope");
tested = new TestProvider(config);
Assert.assertEquals("myscope", tested.getConfig().getDefaultScope());
}
Aggregations