Package org.keycloak.protocol.oidc.utils
Class PairwiseSubMapperUtils
- java.lang.Object
-
- org.keycloak.protocol.oidc.utils.PairwiseSubMapperUtils
-
public class PairwiseSubMapperUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description PairwiseSubMapperUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<ProtocolMapperRepresentation>
getPairwiseSubMappers(ClientRepresentation client)
static boolean
matchesRedirects(String clientRootUrl, Set<String> clientRedirectUris, Set<String> sectorRedirects)
Checks if the the registered client redirect URIs matches the set of redirect URIs from the sector identifier URI.static Set<String>
resolveValidRedirectUris(String clientRootUrl, Collection<String> clientRedirectUris)
Returns a set of valid redirect URIs from the root url and redirect URIs registered on a client.static String
resolveValidSectorIdentifier(String sectorIdentifierUri)
Tries to resolve a valid sector identifier from a sector identifier URI.static String
resolveValidSectorIdentifier(String clientRootUrl, Set<String> clientRedirectUris)
Tries to resolve a valid sector identifier from the redirect URIs registered on a client.
-
-
-
Method Detail
-
resolveValidRedirectUris
public static Set<String> resolveValidRedirectUris(String clientRootUrl, Collection<String> clientRedirectUris)
Returns a set of valid redirect URIs from the root url and redirect URIs registered on a client.- Parameters:
clientRootUrl
-clientRedirectUris
-- Returns:
-
resolveValidSectorIdentifier
public static String resolveValidSectorIdentifier(String sectorIdentifierUri)
Tries to resolve a valid sector identifier from a sector identifier URI.- Parameters:
sectorIdentifierUri
-- Returns:
- a sector identifier iff. the sector identifier URI is a valid URI, contains a valid scheme and contains a valid host component.
-
resolveValidSectorIdentifier
public static String resolveValidSectorIdentifier(String clientRootUrl, Set<String> clientRedirectUris)
Tries to resolve a valid sector identifier from the redirect URIs registered on a client.- Parameters:
clientRootUrl
- Root url registered on the client.clientRedirectUris
- Redirect URIs registered on the client.- Returns:
- a sector identifier iff. all the registered redirect URIs are located at the same host, otherwise
null
.
-
matchesRedirects
public static boolean matchesRedirects(String clientRootUrl, Set<String> clientRedirectUris, Set<String> sectorRedirects)
Checks if the the registered client redirect URIs matches the set of redirect URIs from the sector identifier URI.- Parameters:
clientRootUrl
- root url registered on the client.clientRedirectUris
- redirect URIs registered on the client.sectorRedirects
- value of the sector identifier URI.- Returns:
true
iff. the all the redirect URIs can be described by thesectorRedirects
, i.e if the registered redirect URIs is a subset of thesectorRedirects
, otherwisefalse
.
-
getPairwiseSubMappers
public static List<ProtocolMapperRepresentation> getPairwiseSubMappers(ClientRepresentation client)
-
-