Package org.nuxeo.runtime.api.login
Class NuxeoLoginContext
java.lang.Object
javax.security.auth.login.LoginContext
org.nuxeo.runtime.api.login.NuxeoLoginContext
- All Implemented Interfaces:
AutoCloseable
An implementation of
LoginContext
just holding a principal.
Construction is done through the static create(java.security.Principal)
method, which takes a Principal
. The caller must push
the principal on the Nuxeo principal stack using login()
, and finally do logout()
or close()
to
remove it.
This is used for compatibility with previous code that expected to receive a LoginContext
and then call
logout()
on it.
- Since:
- 11.1
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThis constructor cannot be used, use the static methodcreate(java.security.Principal)
instead. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static NuxeoLoginContext
Creates aNuxeoLoginContext
for the given principal.void
login()
void
logout()
protected void
setPrincipal
(Principal principal)
-
Field Details
-
principal
-
subject
-
loggedIn
protected boolean loggedIn
-
-
Constructor Details
-
NuxeoLoginContext
This constructor cannot be used, use the static methodcreate(java.security.Principal)
instead.- Throws:
LoginException
-
-
Method Details
-
create
Creates aNuxeoLoginContext
for the given principal.- Parameters:
principal
- the principal- Returns:
- the login context
-
setPrincipal
-
getSubject
- Overrides:
getSubject
in classLoginContext
-
login
public void login()- Overrides:
login
in classLoginContext
-
logout
public void logout()- Overrides:
logout
in classLoginContext
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-