Class DefaultSingleSignOn
- java.lang.Object
-
- org.wildfly.security.http.util.sso.DefaultSingleSignOn
-
- All Implemented Interfaces:
AutoCloseable,ImmutableSingleSignOn,SingleSignOn
public class DefaultSingleSignOn extends Object implements SingleSignOn
SingleSignOnimplementation backed by aDefaultSingleSignOnEntry.- Author:
- Pedro Igor, Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description DefaultSingleSignOn(String id, SingleSignOnEntry entry, Runnable mutator, Runnable remover)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddParticipant(String applicationId, String sessionId, URI participant)Adds a new participant to this single sign-on entry.voidclose()Closes any resources associated with this single sign-on entry.StringgetId()Returns the unique identifier of this single sign-on entry.SecurityIdentitygetIdentity()Returns the transient security identity associated with this single sign-on entry.StringgetMechanism()Returns the authentication mechanism associated with this single sign-on entry.StringgetName()Returns the name of the principal associated with this single sign-on entry.Map<String,Map.Entry<String,URI>>getParticipants()Returns the participants associated with this single sign-on entry.voidinvalidate()Invalidates this single sign-on entry.booleanisProgrammatic()Returnstrueif this single sign on is as a result of programmatic authentication.Map.Entry<String,URI>removeParticipant(String applicationId)Removes the participant for the specified application from this single sign-on entry.voidsetIdentity(SecurityIdentity identity)Associates a security identity with this single sign-on entry, only if no association exists.
-
-
-
Field Detail
-
id
private final String id
-
entry
private final SingleSignOnEntry entry
-
mutator
private final Runnable mutator
-
remover
private final Runnable remover
-
-
Constructor Detail
-
DefaultSingleSignOn
public DefaultSingleSignOn(String id, SingleSignOnEntry entry, Runnable mutator, Runnable remover)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:ImmutableSingleSignOnReturns the unique identifier of this single sign-on entry.- Specified by:
getIdin interfaceImmutableSingleSignOn- Returns:
- a unique identifier
-
getMechanism
public String getMechanism()
Description copied from interface:ImmutableSingleSignOnReturns the authentication mechanism associated with this single sign-on entry.- Specified by:
getMechanismin interfaceImmutableSingleSignOn- Returns:
- an authentication mechanism name
-
isProgrammatic
public boolean isProgrammatic()
Description copied from interface:ImmutableSingleSignOnReturnstrueif this single sign on is as a result of programmatic authentication.- Specified by:
isProgrammaticin interfaceImmutableSingleSignOn- Returns:
trueif this single sign on is as a result of programmatic authentication.
-
getName
public String getName()
Description copied from interface:ImmutableSingleSignOnReturns the name of the principal associated with this single sign-on entry.- Specified by:
getNamein interfaceImmutableSingleSignOn- Returns:
- a principal name
-
getIdentity
public SecurityIdentity getIdentity()
Description copied from interface:ImmutableSingleSignOnReturns the transient security identity associated with this single sign-on entry.- Specified by:
getIdentityin interfaceImmutableSingleSignOn- Returns:
- a security identity, or null if this entry was created by another node.
-
setIdentity
public void setIdentity(SecurityIdentity identity)
Description copied from interface:SingleSignOnAssociates a security identity with this single sign-on entry, only if no association exists.- Specified by:
setIdentityin interfaceSingleSignOn- Parameters:
identity- a security identity
-
addParticipant
public boolean addParticipant(String applicationId, String sessionId, URI participant)
Description copied from interface:SingleSignOnAdds a new participant to this single sign-on entry.- Specified by:
addParticipantin interfaceSingleSignOn- Parameters:
applicationId- the unique identifier of the application.sessionId- the unique identifier of the user session.participant- the authenticated request URI- Returns:
- true, if this participant was added, false if this application is already associated with this single sign-on entry.
-
removeParticipant
public Map.Entry<String,URI> removeParticipant(String applicationId)
Description copied from interface:SingleSignOnRemoves the participant for the specified application from this single sign-on entry.- Specified by:
removeParticipantin interfaceSingleSignOn- Parameters:
applicationId- a unique application identifier- Returns:
- a tuple containing the unique session identifier and authenticated request URI, or null if the specified application was not associated with this single sign-on entry
-
getParticipants
public Map<String,Map.Entry<String,URI>> getParticipants()
Description copied from interface:ImmutableSingleSignOnReturns the participants associated with this single sign-on entry.- Specified by:
getParticipantsin interfaceImmutableSingleSignOn- Returns:
- an unmodifiable mapping of application identifier to a tuple of the session identifier and request URI
-
invalidate
public void invalidate()
Description copied from interface:SingleSignOnInvalidates this single sign-on entry.- Specified by:
invalidatein interfaceSingleSignOn
-
close
public void close()
Description copied from interface:SingleSignOnCloses any resources associated with this single sign-on entry.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSingleSignOn
-
-