Class SocialProvidersCondition
java.lang.Object
com.irurueta.authserver.authorization.api.web.social.SocialProvidersCondition
- All Implemented Interfaces:
org.springframework.context.annotation.Condition
public class SocialProvidersCondition
extends Object
implements org.springframework.context.annotation.Condition
Condition that holds when at least one social provider is configured, that is, when some
authserver.social.providers.<id>.client-id has text. Every bean of the social login hangs from it, so with
no provider configured (the default) the application has no social login at all: no client registration
repository (which cannot be empty), no filter and no login page entry.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleanisConfigured(org.springframework.core.env.Environment environment, IdentityProvider provider) Tells whether a provider is configured.booleanmatches(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata) Tells whether any provider is configured.
-
Constructor Details
-
SocialProvidersCondition
public SocialProvidersCondition()
-
-
Method Details
-
isConfigured
static boolean isConfigured(org.springframework.core.env.Environment environment, IdentityProvider provider) Tells whether a provider is configured.- Parameters:
environment- environment to read the setting from.provider- the provider.- Returns:
truewhen the provider's client id has text.
-
matches
public boolean matches(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata) Tells whether any provider is configured.- Specified by:
matchesin interfaceorg.springframework.context.annotation.Condition- Parameters:
context- the condition context.metadata- metadata of the annotated element.- Returns:
truewhen at least one provider is configured.
-