Class SwedishEidDiscoveryMatchingRules
java.lang.Object
se.swedenconnect.opensaml.sweid.saml2.discovery.SwedishEidDiscoveryMatchingRules
A class that implements the Discovery matching rules described in section 1.3 and 1.4 in Entity
Categories for the Swedish eID Framework.
- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isMatch
(Collection<String> consumingService, Collection<String> providingService) Determines if there if the consuming service (SP) may use the providing service (IdP) based on the entity categories that they have declared.static boolean
isServiceContractMatch
(Collection<String> consumingService, Collection<String> providingService) Determines if there is a match regarding service contract categories declared by a consuming service and a providing service.static boolean
isServiceEntityMatch
(Collection<String> consumingService, Collection<String> providingService) Determines if there is a match regarding service entity categories declared by a consuming service and a providing service.static boolean
isServicePropertyMatch
(Collection<String> consumingService, Collection<String> providingService) Determines if there is a match regarding service property categories declared by a consuming service and a providing service.
-
Constructor Details
-
SwedishEidDiscoveryMatchingRules
public SwedishEidDiscoveryMatchingRules()
-
-
Method Details
-
isMatch
public static boolean isMatch(Collection<String> consumingService, Collection<String> providingService) Determines if there if the consuming service (SP) may use the providing service (IdP) based on the entity categories that they have declared.The algorithm is defined in section 1.4 of Entity Categories for the Swedish eID Framework. The discovery process SHOULD display Identity Providers as a plausible choice, if and only if, the following conditions apply;
- the Identity Provider declares at least of the Service Entity Category identifiers declared by the Service
Provider (see
isServiceEntityMatch(Collection, Collection)
), - f the Identity Provider declares at least one Service Contract identifier, the Service Provider must declare at
least one of declared identifiers (
isServiceContractMatch(Collection, Collection)
), and, - all of the Service Property identifiers declared by the Service Provider must be declared by the Identity
Provider (
isServicePropertyMatch(Collection, Collection)
).
- Parameters:
consumingService
- the entity categories declared by the consuming service (SP)providingService
- the entity categories declared by the providing service (IdP)- Returns:
- true if the above algorithm evaluates to
true
andfalse
otherwise - See Also:
- the Identity Provider declares at least of the Service Entity Category identifiers declared by the Service
Provider (see
-
isServiceEntityMatch
public static boolean isServiceEntityMatch(Collection<String> consumingService, Collection<String> providingService) Determines if there is a match regarding service entity categories declared by a consuming service and a providing service. This is the first condition (out of three) of the algorithm defined in section 1.4 of Entity Categories for the Swedish eID Framework.- Parameters:
consumingService
- the entity categories declared by the consuming service (SP)providingService
- the entity categories declared by the providing service (IdP)- Returns:
true
if the providing service declares at least one of the service entity categories declared by the consuming service andfalse
otherwise
-
isServiceContractMatch
public static boolean isServiceContractMatch(Collection<String> consumingService, Collection<String> providingService) Determines if there is a match regarding service contract categories declared by a consuming service and a providing service. This is the second condition (out of threee) of the algorithm defined in section 1.4 of Entity Categories for the Swedish eID Framework.- Parameters:
consumingService
- the entity categories declared by the consuming service (SP)providingService
- the entity categories declared by the providing service (IdP)- Returns:
- if the providing service declares at least one service contract category and the consuming service declares
at least one of those declared identifiers
true
is returned
-
isServicePropertyMatch
public static boolean isServicePropertyMatch(Collection<String> consumingService, Collection<String> providingService) Determines if there is a match regarding service property categories declared by a consuming service and a providing service. This is the third condition (out of threee) of the algorithm defined in section 1.4 of Entity Categories for the Swedish eID Framework.- Parameters:
consumingService
- the entity categories declared by the consuming service (SP)providingService
- the entity categories declared by the providing service (IdP)- Returns:
- if all of the Service Property identifiers declared by the consuming service is declared by the providing
service
true
is returned
-