public class OpenSSOImpl extends AbstractWebBasedSingleSignOn implements SSOMetKeys
AbstractWebBasedSingleSignOn
interface. This
class can be used in e.g., CAS curator to link into Open SSO.req, res
ATTRIBUTES_COMMAND, AUTH_COMMAND, AUTHENTICATE_ENDPOINT, IDENTITY_ATTRIBUTES_ENDPOINT, IDENTITY_COMMAND, IDENTITY_DETAILS_ATTR_NAME, IDENTITY_DETAILS_ATTR_SKIP_LINE, IDENTITY_DETAILS_ATTR_VALUE, IDENTITY_DETAILS_GROUP, IDENTITY_DETAILS_NAME, IDENTITY_DETAILS_REALM, IDENTITY_DETAILS_TYPE, IDENTITY_READ_ENDPOINT, LOGOUT_COMMAND, LOGOUT_ENDPOINT, SSO_COOKIE_KEY, UID_ATTRIBUTE_NAME, UNKNOWN_USER, USER_COOKIE_KEY, USER_DETAILS_ATTR_NAME, USER_DETAILS_ATTR_VALUE, USER_DETAILS_ROLE, USER_DETAILS_TOKEN
Constructor and Description |
---|
OpenSSOImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getCurrentUsername()
Should return the current logged in Single Sign On username returned from
the implementation-specific authentication API.
|
List<String> |
getGroupsForUser()
Gets the SSO groups for the LMMP user, identified by her
ssoAuth , where her User ID is provided by
getCurrentUsername() and her Token is provided by
getSSOToken() . |
boolean |
getLastConnectionStatus()
Should provide information (true or false) as to whether the last
connection to the SSO authentication service was successful.
|
protected String |
getSSOToken() |
boolean |
isLoggedIn()
Returns
true when the user is logged in, or false otherwise. |
boolean |
login(String username,
String password)
Logs the user with the provided
username and
password in to the SSO authentication mechanism. |
void |
logout()
Logs the current SSO user out of her session.
|
List<String> |
retrieveGroupsForUser(String username)
Obtains a user's groups from the security principal that this SSO object
talks to.
|
getReq, getRes, setReq, setRes
public String getCurrentUsername()
SingleSignOn
getCurrentUsername
in interface SingleSignOn
public boolean getLastConnectionStatus()
SingleSignOn
getLastConnectionStatus
in interface SingleSignOn
public boolean isLoggedIn()
SingleSignOn
true
when the user is logged in, or false otherwise.isLoggedIn
in interface SingleSignOn
public boolean login(String username, String password)
SingleSignOn
username
and
password
in to the SSO authentication mechanism.login
in interface SingleSignOn
username
- The username credentials.password
- The password credentials.public void logout()
SingleSignOn
logout
in interface SingleSignOn
public List<String> getGroupsForUser() throws IOException, SingleSignOnException
ssoAuth
, where her User ID is provided by
getCurrentUsername()
and her Token is provided by
getSSOToken()
.List
of String LMMP groups for the User.SingleSignOnException
- If any error (e.g., HTTP REST error) occurs.IOException
- If the SSO token cannot be read.public List<String> retrieveGroupsForUser(String username)
SingleSignOn
retrieveGroupsForUser
in interface SingleSignOn
username
- The username to obtain the groups for.List
of string group names obtained from the security
principal.protected String getSSOToken()
Copyright © 1999–2017 Apache OODT. All rights reserved.