Class MetadataServiceRegistry
- java.lang.Object
-
- net.shibboleth.idp.cas.service.impl.MetadataServiceRegistry
-
- All Implemented Interfaces:
ServiceRegistry
public class MetadataServiceRegistry extends Object implements ServiceRegistry
CAS service registry implementation that queries SAML metadata for a CAS service given a CAS service URL using the following strategy. AMetadataResolveris queried for anEntityDescriptorthat meets the following criteria:- Defines
https://www.apereo.org/cas/protocolin theprotocolSupportEnumerationattribute of anSPSSODescriptorelement. - Defines an
AssertionConsumerServiceelement where theBindingURI is "https://www.apereo.org/cas/protocol/login". - Matching
AssertionConsumerServiceelement also defines aLocationattribute where the given service URL starts with the ACS location.
Serviceand returned; if more than result is found, aResolverExceptionis raised, otherwise null is returned.Two additional aspects of a CAS service may be specified in metadata:
allowedToProxy- True if there is anAssertionConsumerServiceelement with a binding of"https://www.apereo.org/cas/protocol/proxy", false otherwise.singleLogoutParticipant- True if there is aSingleLogoutServiceelement with a binding of"https://www.apereo.org/cas/protocol/logout"and a location of"urn:mace:shibboleth:profile:CAS:logout", false otherwise.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetadataServiceRegistry.LoginEndpointPredicatePredicate defines CAS login endpoints so that the metadata index on endpoints can be scoped to the smallest set needed to support CAS entities in SAML metadata.
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.static StringLOGIN_BINDINGURI identifying an ACS endpoint that requests CAS service tickets.static StringLOGOUT_BINDINGURI identifying a CAS SLO endpoint.static StringLOGOUT_LOCATIONURN marking that SLO endpoint is dynamic based on service ticket URL.private RoleDescriptorResolvermetadataResolverSAML metadata resolver.static StringPROXY_BINDINGURI identifying a CAS proxy callback endoint.
-
Constructor Summary
Constructors Constructor Description MetadataServiceRegistry(RoleDescriptorResolver resolver)Create a new instance that queries the given metadata resolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Servicecreate(String serviceURL, SPSSODescriptor role)Create a CASServicefrom an input service URL and the matchingRoleDescriptorthat was resolved from the metadata source.protected CriteriaSetcriteria(String serviceURL)Create the set of criteria used to find a unique CAS service given a CAS service URL.private booleanhasSingleLogoutService(SPSSODescriptor role)Checks if theEntityDescriptorhas an SLO endpoint.private booleanisAuthorizedToProxy(SPSSODescriptor role)Checks if theEntityDescriptorhave aPROXY_BINDINGacs.Servicelookup(String serviceURL)
-
-
-
Field Detail
-
LOGIN_BINDING
public static final String LOGIN_BINDING
URI identifying an ACS endpoint that requests CAS service tickets.- See Also:
- Constant Field Values
-
LOGOUT_BINDING
public static final String LOGOUT_BINDING
URI identifying a CAS SLO endpoint.- See Also:
- Constant Field Values
-
LOGOUT_LOCATION
public static final String LOGOUT_LOCATION
URN marking that SLO endpoint is dynamic based on service ticket URL.- See Also:
- Constant Field Values
-
PROXY_BINDING
public static final String PROXY_BINDING
URI identifying a CAS proxy callback endoint.- See Also:
- Constant Field Values
-
log
private final org.slf4j.Logger log
Class logger.
-
metadataResolver
@Nonnull private final RoleDescriptorResolver metadataResolver
SAML metadata resolver.
-
-
Constructor Detail
-
MetadataServiceRegistry
public MetadataServiceRegistry(@Nonnull @ParameterName(name="resolver") RoleDescriptorResolver resolver)
Create a new instance that queries the given metadata resolver.- Parameters:
resolver- SAML metadata resolver.
-
-
Method Detail
-
lookup
@Nullable public Service lookup(@Nonnull String serviceURL)
- Specified by:
lookupin interfaceServiceRegistry
-
criteria
@Nonnull protected CriteriaSet criteria(@Nonnull String serviceURL)
Create the set of criteria used to find a unique CAS service given a CAS service URL.- Parameters:
serviceURL- CAS service URL.- Returns:
- Metadata resolver criteria set.
-
create
@Nonnull protected Service create(@Nonnull String serviceURL, @Nonnull SPSSODescriptor role)
Create a CASServicefrom an input service URL and the matchingRoleDescriptorthat was resolved from the metadata source.- Parameters:
serviceURL- CAS service URL.role- resolved from metadata.- Returns:
- CAS service created from inputs.
-
isAuthorizedToProxy
private boolean isAuthorizedToProxy(@Nonnull SPSSODescriptor role)Checks if theEntityDescriptorhave aPROXY_BINDINGacs.- Parameters:
role- what to look at- Returns:
- whether is is authorized to proxy
-
hasSingleLogoutService
private boolean hasSingleLogoutService(@Nonnull SPSSODescriptor role)Checks if theEntityDescriptorhas an SLO endpoint.- Parameters:
role- what to look at- Returns:
- whether it has an SLO endpoint
-
-