Fixes misspelled config class
This commit is contained in:
parent
4aa996c2db
commit
0197600565
5 changed files with 9 additions and 9 deletions
|
@ -16,7 +16,7 @@ import java.util.Optional;
|
|||
/**
|
||||
* Identity provider for Openshift V3. Check <a href="https://docs.openshift.com/enterprise/3.0/architecture/additional_concepts/authentication.html">official documentation</a> for more details.
|
||||
*/
|
||||
public class OpenshiftV3IdentityProvider extends AbstractOAuth2IdentityProvider<OpenshifV3IdentityProviderConfig> implements SocialIdentityProvider<OpenshifV3IdentityProviderConfig> {
|
||||
public class OpenshiftV3IdentityProvider extends AbstractOAuth2IdentityProvider<OpenshiftV3IdentityProviderConfig> implements SocialIdentityProvider<OpenshiftV3IdentityProviderConfig> {
|
||||
|
||||
public static final String BASE_URL = "https://api.preview.openshift.com";
|
||||
private static final String AUTH_RESOURCE = "/oauth/authorize";
|
||||
|
@ -24,7 +24,7 @@ public class OpenshiftV3IdentityProvider extends AbstractOAuth2IdentityProvider<
|
|||
private static final String PROFILE_RESOURCE = "/oapi/v1/users/~";
|
||||
private static final String DEFAULT_SCOPE = "user:info";
|
||||
|
||||
public OpenshiftV3IdentityProvider(KeycloakSession session, OpenshifV3IdentityProviderConfig config) {
|
||||
public OpenshiftV3IdentityProvider(KeycloakSession session, OpenshiftV3IdentityProviderConfig config) {
|
||||
super(session, config);
|
||||
final String baseUrl = Optional.ofNullable(config.getBaseUrl()).orElse(BASE_URL);
|
||||
config.setAuthorizationUrl(baseUrl + AUTH_RESOURCE);
|
||||
|
|
|
@ -3,10 +3,10 @@ package org.keycloak.social.openshift;
|
|||
import org.keycloak.broker.oidc.OAuth2IdentityProviderConfig;
|
||||
import org.keycloak.models.IdentityProviderModel;
|
||||
|
||||
public class OpenshifV3IdentityProviderConfig extends OAuth2IdentityProviderConfig {
|
||||
public class OpenshiftV3IdentityProviderConfig extends OAuth2IdentityProviderConfig {
|
||||
private static final String BASE_URL = "baseUrl";
|
||||
|
||||
public OpenshifV3IdentityProviderConfig(IdentityProviderModel identityProviderModel) {
|
||||
public OpenshiftV3IdentityProviderConfig(IdentityProviderModel identityProviderModel) {
|
||||
super(identityProviderModel);
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@ public class OpenshiftV3IdentityProviderFactory extends AbstractIdentityProvider
|
|||
|
||||
@Override
|
||||
public OpenshiftV3IdentityProvider create(KeycloakSession keycloakSession, IdentityProviderModel identityProviderModel) {
|
||||
return new OpenshiftV3IdentityProvider(keycloakSession, new OpenshifV3IdentityProviderConfig(identityProviderModel));
|
||||
return new OpenshiftV3IdentityProvider(keycloakSession, new OpenshiftV3IdentityProviderConfig(identityProviderModel));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -8,7 +8,7 @@ public class OpenshiftV3IdentityProviderTest {
|
|||
|
||||
@Test
|
||||
public void shouldConstructProviderUrls() throws Exception {
|
||||
final OpenshifV3IdentityProviderConfig config = new OpenshifV3IdentityProviderConfig(new IdentityProviderModel());
|
||||
final OpenshiftV3IdentityProviderConfig config = new OpenshiftV3IdentityProviderConfig(new IdentityProviderModel());
|
||||
config.setBaseUrl("http://openshift.io:8443");
|
||||
final OpenshiftV3IdentityProvider openshiftV3IdentityProvider = new OpenshiftV3IdentityProvider(null, config);
|
||||
|
||||
|
@ -17,7 +17,7 @@ public class OpenshiftV3IdentityProviderTest {
|
|||
|
||||
@Test
|
||||
public void shouldConstructProviderUrlsForBaseUrlWithTrailingSlash() throws Exception {
|
||||
final OpenshifV3IdentityProviderConfig config = new OpenshifV3IdentityProviderConfig(new IdentityProviderModel());
|
||||
final OpenshiftV3IdentityProviderConfig config = new OpenshiftV3IdentityProviderConfig(new IdentityProviderModel());
|
||||
config.setBaseUrl("http://openshift.io:8443/");
|
||||
final OpenshiftV3IdentityProvider openshiftV3IdentityProvider = new OpenshiftV3IdentityProvider(null, config);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.keycloak.social.google.GoogleIdentityProvider;
|
|||
import org.keycloak.social.google.GoogleIdentityProviderFactory;
|
||||
import org.keycloak.social.linkedin.LinkedInIdentityProvider;
|
||||
import org.keycloak.social.linkedin.LinkedInIdentityProviderFactory;
|
||||
import org.keycloak.social.openshift.OpenshifV3IdentityProviderConfig;
|
||||
import org.keycloak.social.openshift.OpenshiftV3IdentityProviderConfig;
|
||||
import org.keycloak.social.openshift.OpenshiftV3IdentityProvider;
|
||||
import org.keycloak.social.openshift.OpenshiftV3IdentityProviderFactory;
|
||||
import org.keycloak.social.stackoverflow.StackOverflowIdentityProviderConfig;
|
||||
|
@ -290,7 +290,7 @@ public class ImportIdentityProviderTest extends AbstractIdentityProviderModelTes
|
|||
|
||||
private void assertOpenshiftIdentityProviderConfig(IdentityProviderModel identityProvider) {
|
||||
OpenshiftV3IdentityProvider osoIdentityProvider = new OpenshiftV3IdentityProviderFactory().create(session, identityProvider);
|
||||
OpenshifV3IdentityProviderConfig config = osoIdentityProvider.getConfig();
|
||||
OpenshiftV3IdentityProviderConfig config = osoIdentityProvider.getConfig();
|
||||
|
||||
assertEquals("model-openshift-v3", config.getAlias());
|
||||
assertEquals(OpenshiftV3IdentityProviderFactory.PROVIDER_ID, config.getProviderId());
|
||||
|
|
Loading…
Reference in a new issue