Search in sources :

Example 1 with OidcMetadataFetcher

use of org.cloudfoundry.identity.uaa.provider.oauth.OidcMetadataFetcher in project uaa by cloudfoundry.

the class LoginInfoEndpointTests method setUp.

@BeforeEach
void setUp() {
    IdentityZoneHolder.clear();
    marissa = new UaaPrincipal("marissa-id", "marissa", "marissa@test.org", "origin", null, IdentityZoneHolder.get().getId());
    prompts = new LinkedList<>();
    prompts.add(new Prompt("username", "text", "Email"));
    prompts.add(new Prompt("password", "password", "Password"));
    prompts.add(new Prompt("passcode", "text", "Temporary Authentication Code ( Get one at " + HTTP_LOCALHOST_8080_UAA + "/passcode )"));
    mockSamlIdentityProviderConfigurator = mock(SamlIdentityProviderConfigurator.class);
    when(mockSamlIdentityProviderConfigurator.getIdentityProviderDefinitions()).thenReturn(emptyList());
    when(mockSamlIdentityProviderConfigurator.getIdentityProviderDefinitionsForZone(any())).thenReturn(emptyList());
    mockIdentityProviderProvisioning = mock(IdentityProviderProvisioning.class);
    uaaIdentityProvider = new IdentityProvider();
    when(mockIdentityProviderProvisioning.retrieveByOriginIgnoreActiveFlag(eq(OriginKeys.UAA), anyString())).thenReturn(uaaIdentityProvider);
    when(mockIdentityProviderProvisioning.retrieveByOrigin(eq(OriginKeys.LDAP), anyString())).thenReturn(new IdentityProvider());
    idps = getIdps();
    originalConfiguration = IdentityZoneHolder.get().getConfig();
    OidcMetadataFetcher mockOidcMetadataFetcher = mock(OidcMetadataFetcher.class);
    IdentityZoneHolder.get().setConfig(new IdentityZoneConfiguration());
    configurator = new ExternalOAuthProviderConfigurator(mockIdentityProviderProvisioning, mockOidcMetadataFetcher, mock(UaaRandomStringUtil.class));
    spiedMfaChecker = spy(new MfaChecker(mock(IdentityZoneProvisioning.class)));
    extendedModelMap = new ExtendedModelMap();
}
Also used : UaaPrincipal(org.cloudfoundry.identity.uaa.authentication.UaaPrincipal) ExternalOAuthProviderConfigurator(org.cloudfoundry.identity.uaa.provider.oauth.ExternalOAuthProviderConfigurator) IdentityZoneProvisioning(org.cloudfoundry.identity.uaa.zone.IdentityZoneProvisioning) ExtendedModelMap(org.springframework.ui.ExtendedModelMap) IdentityProviderProvisioning(org.cloudfoundry.identity.uaa.provider.IdentityProviderProvisioning) OidcMetadataFetcher(org.cloudfoundry.identity.uaa.provider.oauth.OidcMetadataFetcher) MfaChecker(org.cloudfoundry.identity.uaa.mfa.MfaChecker) IdentityProvider(org.cloudfoundry.identity.uaa.provider.IdentityProvider) SamlIdentityProviderConfigurator(org.cloudfoundry.identity.uaa.provider.saml.SamlIdentityProviderConfigurator) IdentityZoneConfiguration(org.cloudfoundry.identity.uaa.zone.IdentityZoneConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

UaaPrincipal (org.cloudfoundry.identity.uaa.authentication.UaaPrincipal)1 MfaChecker (org.cloudfoundry.identity.uaa.mfa.MfaChecker)1 IdentityProvider (org.cloudfoundry.identity.uaa.provider.IdentityProvider)1 IdentityProviderProvisioning (org.cloudfoundry.identity.uaa.provider.IdentityProviderProvisioning)1 ExternalOAuthProviderConfigurator (org.cloudfoundry.identity.uaa.provider.oauth.ExternalOAuthProviderConfigurator)1 OidcMetadataFetcher (org.cloudfoundry.identity.uaa.provider.oauth.OidcMetadataFetcher)1 SamlIdentityProviderConfigurator (org.cloudfoundry.identity.uaa.provider.saml.SamlIdentityProviderConfigurator)1 IdentityZoneConfiguration (org.cloudfoundry.identity.uaa.zone.IdentityZoneConfiguration)1 IdentityZoneProvisioning (org.cloudfoundry.identity.uaa.zone.IdentityZoneProvisioning)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ExtendedModelMap (org.springframework.ui.ExtendedModelMap)1