public final class RBACSession extends Object implements IPropertyChangeListener
getSID(boolean)
to
retrieve the session ID required by many TextGrid services and utilities.Modifier and Type | Method and Description |
---|---|
protected static void |
authDialogIsOpen(boolean state) |
info.textgrid.namespaces.middleware.tgauth.UserDetail |
getDetails(String ePPN) |
String |
getEPPN()
Retrieve the EPPN (the Shibboleth-wide user id) for the user.
|
ArrayList<info.textgrid.namespaces.middleware.tgauth.Friend> |
getFriends(boolean retrieveFromRBAC) |
String |
getFullName(String ePPN)
Returns Full Name for an ePPN-like ID, e.g.
|
static RBACSession |
getInstance()
Retrieve a singleton representing the current session.
|
info.textgrid.namespaces.metadata.agent._2010.PersonType |
getPerson()
Returns a
PersonType record for the current user. |
info.textgrid.namespaces.metadata.agent._2010.PersonType |
getPerson(String ePPN)
Generates a
PersonType record for the TextGrid user identified by
the given ID. |
String |
getSID(boolean openAuthNDialogue)
Retrieve a session ID for the current user.
|
static void |
login(String sid,
String eppn,
boolean save)
Log the user in using the specified SID and ePPN and notify listeners.
|
static void |
logout() |
static void |
neverAsk(boolean state)
Set to true if you do not want the login dialogue to appear anymore in
this Lab instance, except for Help->Authentication->Re-Authenticate where
it will be set to false before authenticating.
|
void |
propertyChange(PropertyChangeEvent event) |
void |
reauthenticate() |
void |
retrieveDetailsFromRBAC(ArrayList<String> ePPNs) |
protected void |
showLoginDialogBlocking() |
public static RBACSession getInstance()
public static void login(String sid, String eppn, boolean save)
save
- if true
, save SID and ePPN for reuse.public static void logout()
public void reauthenticate()
public static void neverAsk(boolean state)
state
- protected static void authDialogIsOpen(boolean state)
public String getSID(boolean openAuthNDialogue)
The session ID is a string generated by the TG-auth* utility after
presenting the user a login dialog. It is used by TG-auth* to identify
the roles and permissions a certain user has. The session ID
""
(i.e. the empty string) identifies anonymous users.
openAuthNDialogue
- if false
, this call will never open a login
dialog (but return ""
for unauthenticated users).
If true
and if the user has neither
logged in yet nor checked the
don't ask again, I want to work anonymously checkbox
(see neverAsk(boolean)
, a login dialog is shown.null
, but may be ""
to identify anonymous users.protected void showLoginDialogBlocking()
public String getEPPN()
""
when working anonymously.public void propertyChange(PropertyChangeEvent event)
propertyChange
in interface IPropertyChangeListener
public ArrayList<info.textgrid.namespaces.middleware.tgauth.Friend> getFriends(boolean retrieveFromRBAC)
public info.textgrid.namespaces.middleware.tgauth.UserDetail getDetails(String ePPN)
public info.textgrid.namespaces.metadata.agent._2010.PersonType getPerson(String ePPN)
PersonType
record for the TextGrid user identified by
the given ID.ePPN
- getEPPN() EPPN} of the user for which to
retrieve dataPersonType
record with the
ID filled with the EPPN and the
value being the user's namepublic String getFullName(String ePPN)
ePPN
- public info.textgrid.namespaces.metadata.agent._2010.PersonType getPerson()
PersonType
record for the current user.getPerson(String)
,
getEPPN()