Class CheckRedirectURIs
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- net.shibboleth.idp.profile.AbstractProfileAction
-
- net.shibboleth.idp.plugin.oidc.op.profile.impl.CheckRedirectURIs
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class CheckRedirectURIs extends net.shibboleth.idp.profile.AbstractProfileActionThe action that verifies the redirect_uris from the request. At least one must exist. Also, if sector_identifier_uri has been defined in the request, all the redirect_uris must exists from the contents behind the URI.
The specification defines the following for
application_type:Web Clients using the OAuth Implicit Grant Type MUST only register URLs using the https scheme as redirect_uris; they MUST NOT use localhost as the hostname. Native Clients MUST only register redirect_uris using custom URI schemes or URLs using the http: scheme with localhost as the hostname. Authorization Servers MAY place additional constraints on Native Clients. Authorization Servers MAY reject Redirection URI values using the http scheme, other than the localhost case for Native Clients.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.http.client.HttpClienthttpClientTheHttpClientto use.private HttpClientSecurityParametershttpClientSecurityParametersHTTP client security parameters.private org.slf4j.LoggerlogClass logger.private com.nimbusds.openid.connect.sdk.rp.OIDCClientRegistrationRequestrequestThe OIDCClientRegistrationRequest to check redirect URIs from.
-
Constructor Summary
Constructors Constructor Description CheckRedirectURIs()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckForbiddenHostname(Set<URI> redirectURIs, String hostname)Checks whether a given hostname is found from the given set of URIs.protected booleancheckForbiddenScheme(Set<URI> redirectURIs, String scheme)Checks whether a given scheme is found from the given set of URIs.protected booleancheckScheme(Set<URI> redirectURIs, String scheme)Checks whether a given scheme is used by every item in the given set of URIs.protected voiddoExecute(ProfileRequestContext profileRequestContext)voiddoInitialize()protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetHttpClient(org.apache.http.client.HttpClient client)Set theHttpClientto use.voidsetHttpClientSecurityParameters(HttpClientSecurityParameters params)Set the optional client security parameters.protected booleanverifySectorIdUri(URI sectorIdUri, Set<URI> redirectURIs)Verifies that all the given redirect URIs are found from the contents of the given sector identifier URI.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
request
@Nullable private com.nimbusds.openid.connect.sdk.rp.OIDCClientRegistrationRequest request
The OIDCClientRegistrationRequest to check redirect URIs from.
-
httpClient
@NonnullAfterInit private org.apache.http.client.HttpClient httpClient
TheHttpClientto use.
-
httpClientSecurityParameters
@Nullable private HttpClientSecurityParameters httpClientSecurityParameters
HTTP client security parameters.
-
-
Method Detail
-
setHttpClient
public void setHttpClient(@Nonnull org.apache.http.client.HttpClient client)Set theHttpClientto use.- Parameters:
client- client to use
-
setHttpClientSecurityParameters
public void setHttpClientSecurityParameters(@Nullable HttpClientSecurityParameters params)Set the optional client security parameters.- Parameters:
params- the new client security parameters
-
doInitialize
public void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
verifySectorIdUri
protected boolean verifySectorIdUri(URI sectorIdUri, Set<URI> redirectURIs)
Verifies that all the given redirect URIs are found from the contents of the given sector identifier URI.- Parameters:
sectorIdUri- The sector identifier URI.redirectURIs- The redirect URIs to be verified.- Returns:
- true if redirect URIs were found from the contents, false otherwise or if the contents could not be fetched.
-
checkScheme
protected boolean checkScheme(Set<URI> redirectURIs, String scheme)
Checks whether a given scheme is used by every item in the given set of URIs.- Parameters:
redirectURIs- The URIs to check from.scheme- The scheme to check.- Returns:
- true if scheme was used in all URIs, false otherwise.
-
checkForbiddenScheme
protected boolean checkForbiddenScheme(Set<URI> redirectURIs, String scheme)
Checks whether a given scheme is found from the given set of URIs.- Parameters:
redirectURIs- The URIs to check from.scheme- The scheme to check.- Returns:
- true if scheme was found once or more, false otherwise.
-
checkForbiddenHostname
protected boolean checkForbiddenHostname(Set<URI> redirectURIs, String hostname)
Checks whether a given hostname is found from the given set of URIs.- Parameters:
redirectURIs- The URIs to check from.hostname- The hostname to check.- Returns:
- true if hostname was found once or more, false otherwise.
-
-