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
SingleSignOn
implementation 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 boolean
addParticipant(String applicationId, String sessionId, URI participant)
Adds a new participant to this single sign-on entry.void
close()
Closes any resources associated with this single sign-on entry.String
getId()
Returns the unique identifier of this single sign-on entry.SecurityIdentity
getIdentity()
Returns the transient security identity associated with this single sign-on entry.String
getMechanism()
Returns the authentication mechanism associated with this single sign-on entry.String
getName()
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.void
invalidate()
Invalidates this single sign-on entry.boolean
isProgrammatic()
Returnstrue
if 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.void
setIdentity(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:ImmutableSingleSignOn
Returns the unique identifier of this single sign-on entry.- Specified by:
getId
in interfaceImmutableSingleSignOn
- Returns:
- a unique identifier
-
getMechanism
public String getMechanism()
Description copied from interface:ImmutableSingleSignOn
Returns the authentication mechanism associated with this single sign-on entry.- Specified by:
getMechanism
in interfaceImmutableSingleSignOn
- Returns:
- an authentication mechanism name
-
isProgrammatic
public boolean isProgrammatic()
Description copied from interface:ImmutableSingleSignOn
Returnstrue
if this single sign on is as a result of programmatic authentication.- Specified by:
isProgrammatic
in interfaceImmutableSingleSignOn
- Returns:
true
if this single sign on is as a result of programmatic authentication.
-
getName
public String getName()
Description copied from interface:ImmutableSingleSignOn
Returns the name of the principal associated with this single sign-on entry.- Specified by:
getName
in interfaceImmutableSingleSignOn
- Returns:
- a principal name
-
getIdentity
public SecurityIdentity getIdentity()
Description copied from interface:ImmutableSingleSignOn
Returns the transient security identity associated with this single sign-on entry.- Specified by:
getIdentity
in 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:SingleSignOn
Associates a security identity with this single sign-on entry, only if no association exists.- Specified by:
setIdentity
in interfaceSingleSignOn
- Parameters:
identity
- a security identity
-
addParticipant
public boolean addParticipant(String applicationId, String sessionId, URI participant)
Description copied from interface:SingleSignOn
Adds a new participant to this single sign-on entry.- Specified by:
addParticipant
in 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:SingleSignOn
Removes the participant for the specified application from this single sign-on entry.- Specified by:
removeParticipant
in 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:ImmutableSingleSignOn
Returns the participants associated with this single sign-on entry.- Specified by:
getParticipants
in 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:SingleSignOn
Invalidates this single sign-on entry.- Specified by:
invalidate
in interfaceSingleSignOn
-
close
public void close()
Description copied from interface:SingleSignOn
Closes any resources associated with this single sign-on entry.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSingleSignOn
-
-