Package net.shibboleth.idp.authn.context
Class ExternalAuthenticationContext
- java.lang.Object
-
- org.opensaml.messaging.context.BaseContext
-
- net.shibboleth.idp.authn.context.ExternalAuthenticationContext
-
- All Implemented Interfaces:
Iterable<BaseContext>
public final class ExternalAuthenticationContext extends BaseContext
A context representing the state of an externalized authentication attempt, a case where authentication happens outside of a web flow.- Parent:
AuthenticationContext- Added:
- Before dispatching control to an external login flow
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext
BaseContext.ContextSetNoRemoveIteratorDecorator
-
-
Field Summary
Fields Modifier and Type Field Description private Collection<String>authenticatingAuthoritiesProxied authenticating sources.private StringauthnErrorError message.private ExceptionauthnExceptionException.private InstantauthnInstantTime of authentication.private booleandoNotCacheFlag preventing caching of result for SSO.private ExternalAuthenticationexternalAuthenticationImplementation object.private StringflowExecutionUrlValue of flowExecutionUrl on branching from flow.private booleanpreviousResultFlag indicating this "new" result is really "old".private PrincipalprincipalAPrincipalthat was authenticated.private StringprincipalNameName of a principal that was authenticated.private SubjectsubjectName of aSubjectthat was authenticated.
-
Constructor Summary
Constructors Constructor Description ExternalAuthenticationContext(ExternalAuthentication authentication)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoNotCache()Get the "do not cache" flag.Collection<String>getAuthenticatingAuthorities()Get a mutable, ordered list of proxied authentication sources.StringgetAuthnError()Get an error message from the authentication process.ExceptiongetAuthnException()Get an exception from the authentication process.InstantgetAuthnInstant()Get the time of authentication.ExternalAuthenticationgetExternalAuthentication()Get theExternalAuthenticationobject installed in the context.StringgetFlowExecutionUrl()Get the flow execution URL to return control to.PrincipalgetPrincipal()Get aPrincipalthat was authenticated.StringgetPrincipalName()Get the name of a principal that was authenticated.SubjectgetSubject()Get aSubjectthat was authenticated.booleanisPreviousResult()Get whether this result is the product of an external SSO event and not a new act of authentication.ExternalAuthenticationContextsetAuthnError(String message)Set an error message from the authentication process.ExternalAuthenticationContextsetAuthnException(Exception exception)Set an exception from the authentication process.ExternalAuthenticationContextsetAuthnInstant(Instant instant)Set the time of authentication.ExternalAuthenticationContextsetDoNotCache(boolean flag)Set the "do not cache" flag.ExternalAuthenticationContextsetFlowExecutionUrl(String url)Set the flow execution URL to return control to.ExternalAuthenticationContextsetPreviousResult(boolean flag)Set whether this result is the product of an external SSO event and not a new act of authentication.ExternalAuthenticationContextsetPrincipal(Principal prin)Set aPrincipalthat was authenticated.ExternalAuthenticationContextsetPrincipalName(String name)Set the name of a principal that was authenticated.ExternalAuthenticationContextsetSubject(Subject sub)Set aSubjectthat was authenticated.-
Methods inherited from class org.opensaml.messaging.context.BaseContext
addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeSubcontext, removeSubcontext, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
externalAuthentication
@Nonnull private final ExternalAuthentication externalAuthentication
Implementation object.
-
flowExecutionUrl
@Nullable private String flowExecutionUrl
Value of flowExecutionUrl on branching from flow.
-
principalName
@Nullable private String principalName
Name of a principal that was authenticated.
-
authnInstant
@Nullable private Instant authnInstant
Time of authentication.
-
authenticatingAuthorities
@Nonnull @NonnullElements private Collection<String> authenticatingAuthorities
Proxied authenticating sources.
-
authnError
@Nullable private String authnError
Error message.
-
authnException
@Nullable private Exception authnException
Exception.
-
doNotCache
private boolean doNotCache
Flag preventing caching of result for SSO.
-
previousResult
private boolean previousResult
Flag indicating this "new" result is really "old".
-
-
Constructor Detail
-
ExternalAuthenticationContext
public ExternalAuthenticationContext(@Nonnull ExternalAuthentication authentication)Constructor.- Parameters:
authentication- implementation object
-
-
Method Detail
-
getExternalAuthentication
@Nonnull public ExternalAuthentication getExternalAuthentication()
Get theExternalAuthenticationobject installed in the context.- Returns:
- the external authentication implementation
- Since:
- 4.0.0
-
getFlowExecutionUrl
@Nullable public String getFlowExecutionUrl()
Get the flow execution URL to return control to.- Returns:
- return location
-
setFlowExecutionUrl
@Nonnull public ExternalAuthenticationContext setFlowExecutionUrl(@Nullable String url)
Set the flow execution URL to return control to.- Parameters:
url- return location- Returns:
- this context
-
getPrincipal
@Nullable public Principal getPrincipal()
Get aPrincipalthat was authenticated.- Returns:
- the principal
-
setPrincipal
@Nonnull public ExternalAuthenticationContext setPrincipal(@Nullable Principal prin)
Set aPrincipalthat was authenticated.- Parameters:
prin- principal to set- Returns:
- this context
-
getPrincipalName
@Nullable public String getPrincipalName()
Get the name of a principal that was authenticated.- Returns:
- name of a principal
-
setPrincipalName
@Nonnull public ExternalAuthenticationContext setPrincipalName(@Nullable String name)
Set the name of a principal that was authenticated.- Parameters:
name- name of principal to set- Returns:
- this context
-
getSubject
@Nullable public Subject getSubject()
Get aSubjectthat was authenticated.- Returns:
- subject that was authenticated
-
setSubject
@Nonnull public ExternalAuthenticationContext setSubject(@Nullable Subject sub)
Set aSubjectthat was authenticated.- Parameters:
sub- The subject to set- Returns:
- this context
-
getAuthnInstant
@Nullable public Instant getAuthnInstant()
Get the time of authentication.- Returns:
- time of authentication
-
setAuthnInstant
@Nonnull public ExternalAuthenticationContext setAuthnInstant(@Nullable Instant instant)
Set the time of authentication.- Parameters:
instant- time of authentication to set- Returns:
- this context
-
getAuthenticatingAuthorities
@Nonnull @NonnullElements @Live public Collection<String> getAuthenticatingAuthorities()
Get a mutable, ordered list of proxied authentication sources.- Returns:
- proxied authentication sources
- Since:
- 3.4.0
-
getAuthnError
@Nullable public String getAuthnError()
Get an error message from the authentication process.- Returns:
- an error message
-
setAuthnError
@Nonnull public ExternalAuthenticationContext setAuthnError(@Nullable String message)
Set an error message from the authentication process.- Parameters:
message- message to set- Returns:
- this context
-
getAuthnException
@Nullable public Exception getAuthnException()
Get an exception from the authentication process.- Returns:
- an exception
-
setAuthnException
@Nonnull public ExternalAuthenticationContext setAuthnException(@Nullable Exception exception)
Set an exception from the authentication process.- Parameters:
exception- exception to set- Returns:
- this context
-
doNotCache
public boolean doNotCache()
Get the "do not cache" flag.- Returns:
- true iff the result of the authentication should not be cached
-
setDoNotCache
@Nonnull public ExternalAuthenticationContext setDoNotCache(boolean flag)
Set the "do not cache" flag.- Parameters:
flag- flag to set- Returns:
- this context
-
isPreviousResult
public boolean isPreviousResult()
Get whether this result is the product of an external SSO event and not a new act of authentication.- Returns:
- true iff this result was produced as part of an earlier request
- Since:
- 3.3.0
-
setPreviousResult
@Nonnull public ExternalAuthenticationContext setPreviousResult(boolean flag)
Set whether this result is the product of an external SSO event and not a new act of authentication.- Parameters:
flag- flag to set- Returns:
- this context
- Since:
- 3.3.0
-
-