Class SamlInterceptor
-
- All Implemented Interfaces:
-
okhttp3.Interceptor
public final class SamlInterceptor implements InterceptorEnables SAML authentication with OkHttp by implementing a okhttp3.Interceptor. This class detects SAML challenges, but uses a SamlProcessor to authenticate when a challenge is detected. If a SamlProcessor is not specified, SamlWebViewProcessor is used by default.
-
-
Field Summary
Fields Modifier and Type Field Description private final volatile CallauthenticatingCall
-
Constructor Summary
Constructors Constructor Description SamlInterceptor(SamlProcessor samlProcessor)Constructs a new SamlInterceptor. SamlInterceptor()Constructs a new SamlInterceptor. SamlInterceptor(SamlProcessor samlProcessor, String challengeHeaderName, String challengeHeaderValue)Constructs a new SamlInterceptor. SamlInterceptor(SamlConfiguration samlConfiguration)Constructs a new SamlInterceptor with the default SamlWebViewProcessor. SamlInterceptor(SettingsParameters settingsParameters)Constructs a new SamlInterceptor.
-
Method Summary
Modifier and Type Method Description final CallgetAuthenticatingCall()Responseintercept(Interceptor.Chain chain)final Collection<Call>getQueuedCalls()Gets an unmodifiable collection containing all the Calls that are queued up for authentication. final SamlInterceptorcloneSilent()-
-
Constructor Detail
-
SamlInterceptor
SamlInterceptor(SamlProcessor samlProcessor)
Constructs a new SamlInterceptor.- Parameters:
samlProcessor- The SamlProcessor that will be used to authenticate when a SAML challenge is detected.
-
SamlInterceptor
SamlInterceptor()
Constructs a new SamlInterceptor.
-
SamlInterceptor
SamlInterceptor(SamlProcessor samlProcessor, String challengeHeaderName, String challengeHeaderValue)
Constructs a new SamlInterceptor.- Parameters:
samlProcessor- The SamlProcessor that will be used to authenticate when a SAML challenge is detected.challengeHeaderName- The header name that indicates a SAML challenge.challengeHeaderValue- The header value that indicates a SAML challenge.
-
SamlInterceptor
SamlInterceptor(SamlConfiguration samlConfiguration)
Constructs a new SamlInterceptor with the default SamlWebViewProcessor.- Parameters:
samlConfiguration- The challenge header name and value are set from this object.
-
SamlInterceptor
SamlInterceptor(SettingsParameters settingsParameters)
Constructs a new SamlInterceptor.- Parameters:
settingsParameters- A SamlWebViewProcessor is created with this object.
-
-
Method Detail
-
getAuthenticatingCall
final Call getAuthenticatingCall()
-
intercept
Response intercept(Interceptor.Chain chain)
-
getQueuedCalls
final Collection<Call> getQueuedCalls()
Gets an unmodifiable collection containing all the Calls that are queued up for authentication. Note that the authentication flow will only be re-run for Calls in the collection if authentication fails for the Call currently being authenticated. Calls in the collection may be cancelled. Authentication will not be done for a queued Call that has been cancelled.
- Returns:
An unmodifiable collection containing the Calls awaiting authentication.
-
cloneSilent
final SamlInterceptor cloneSilent()
-
-
-
-