Package com.sas.services.user
Class UserContext
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sas.services.user.UserContext
- All Implemented Interfaces:
com.sas.metadata.remote.CredentialResolver,UserContextInterface,Serializable,Remote
The UserContext provides handles to the user identities and profile services. It is basically a clearinghouse for any
information that applies to a user but is not session oriented. It has a name, a set of identities (credential sets),
a handle to the UserProfile, and a list of repositories the user is connected to. It also has a JAAS LoginContext and
a callback handler that is used for any authentication operations requested by or for this user.
- Since:
- 1.0
- See Also:
-
Field Summary
FieldsFields inherited from class java.rmi.server.RemoteObject
refFields inherited from interface com.sas.services.user.UserContextInterface
IDPROPAGATION_SSPI, IDPROPAGATION_TRUSTED_PEER, INTERNAL_AUTH_DOMAIN, SHAREDRESOURCEKEY_ENVIRONMENT, SHAREDRESOURCEKEY_SERVICEID -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a user context which will be exported as a remote object to the RMI system using the specified client and server socket factories.UserContext(String name) Construct a new user context with the user name.UserContext(Subject subject) Constructs a user context for the specified subject. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddException(Exception exception) Adds an exception.voidaddIdentity(UserIdentityInterface identity) Adds a new authentication identity to this user context.voidaddRepository(Object repository) Add a repository to this user context.voidAdd a repository group to this UserContext.voidaddServer(ServerInterface server) Add a server to the list that this user is connected to.voidaddUserIdentityListener(UserIdentityListener listener) booleanAuthenticate a user based on their current OS identity.booleanauthenticate(UserIdentityInterface ident, Map options) Authenticates a user identity.voidClears the exceptions.voiddestroy()Destroy the user context.voidenableLocalAdminMode(String authDomain) This sets up a special case where an administrative user with an internal account is used to authenticate a user.booleanequals(Object o) Test against another object for equality.ListgetActions(String appName) Get a List of actions associated with an application that this user can perform.ListgetActions(String appName, boolean onlyGrantedActions) Get a List of actions associated with an application.final StringGet the name of the application that initiated the login request for this UserContext.Get a handle to the repository the user authenticated against.StringGet the Information Service configured name of the repository that was used for authentication.Get a handle to the metadata server the user authenticated against.StringGet the definition name of the server the user authenticated against.Get the object that will handle credential challenge callbacks.final StringGet the client location idetifier where the login request originated.StringGet the common description for this user.Exception[]Gets the exceptions.Map<String, ApplicationAuthorization> getGrantedApplicationActions(String... applicationName) Returns a map of actions granted to the user for the specified application(s).ListGet a List of the groups this user is a member of.ListGet an Iterator of the identities which exist for this user context.ListgetIdentitiesByDomain(String domain, boolean issueChallenge, String challengePrompt) This method returns a list of all the credential sets that are available for the requested domain.getIdentityByDomain(String domain) Get an identity by domain.getIdentityByDomain(String domain, boolean issueChallenge) Get an identity by domain.getIdentityByDomain(String domain, boolean issueChallenge, String prompt) Gets a user identify by domain.StringIf the UserContext was authenticated using an ID propagation mechanism such as SSPI, the name of the ID propagation mechanism is returned.static InformationServiceInterfaceGets a foundation Information Service.StringgetKey()Get the user key.LocaleGet the locale for this user.Get the callback handler.protected StringlongGet the timestamp when the user was authenticated.StringgetName()Get the user name.Return the IdentityInterface object that represents this user.StringGet the FQID of the authenticated Identity.SetGets the set of principals.SetGets the set of private credentials.Get the User's profile context.SetGets the set of public credentials.ListGet an iterator of the repositories this user is connected to.getRepository(String name) Gets the repository for the specified name.getRepositoryGroup(String name) Get a repository group from this UserContext.final StringReturn the metadata server resolved user id.ListgetRoles()Get a List of the roles this user is a member of.getServer(String name) Get a specific named Information Service server from this user.ListGet a List of the servers this user is connected to.Get the session context for this user.ObjectgetSharedResource(String key) Get an object from the shared resource map.StringGets the unique ID associated with this user context.static UserServiceInterfaceGets a foundation User Service.static UserServiceInterfacegetUserService(String serviceId) booleanhasCapability(String appName, String action) Check whether this user has the capability to perform a specific action for a particular application.booleanDetermines whether or not this user context has been destroyed.booleanisInAnyGroup(List groupList) Check whether the user is a member of any of the groups in the list.booleanisInAnyRole(List roleList) Check whether the user is a member of any of the roles in the list.booleanisInGroup(String group) Check whether the user is a member of a given group.booleanisInRole(String role) Check whether the user is a member of a given role.final booleanReturn a boolean indicating if this user was created using an internal userid.ObjectputSharedResource(String key, Object value) Put an object into the shared resource map.voidRefresh all of the data that's been retrieved using the Information Service during the life of this UserContext.voidremoveIdentity(UserIdentityInterface identity) Remove an identity from the context.voidremoveRepository(Object repository) Remove a repository from this context.voidRemove a repository group from this UserContext.voidremoveServer(ServerInterface server) Remove a server from the list that this user is currently connected to.ListrequestCredentialList(String authDomain, boolean issueChallenge, String prompt) com.sas.metadata.remote.MdCredentialrequestCredentials(String authDomain, boolean issueChallenge, String prompt) voidsetAppSource(String source) Set the application source identifier that initiated the logon request for this UserContext.voidSet the object that will be used to handle credential challenge callbacks.voidsetClientSource(String source) Set the source location identifier for this UserContext.voidsetKey(String key) Set the user key.voidsetLocale(Locale locale) Set the locale to use for this user session.voidsetName(String name) Set the user name.voidsetPerson(IdentityInterface identity) This method gets called by UserService as part of the UserContext initialization.voidsetSessionContext(SessionContextInterface session) Set the session context that this user context will use for logging, etc.byte[]StringtoString()Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLogMethods inherited from class java.rmi.server.RemoteObject
getRef, hashCode, toStubMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
MIDTIERINTERNAL_DOMAIN
public static final String MIDTIERINTERNAL_DOMAIN- See Also:
-
-
Constructor Details
-
UserContext
public UserContext(Subject subject) throws RemoteException Constructs a user context for the specified subject.- Parameters:
subject- User context's subject.- Throws:
RemoteException- if a networking issue is encountered.
-
UserContext
public UserContext() throws RemoteExceptionConstructs a user context which will be exported as a remote object to the RMI system using the specified client and server socket factories.- Throws:
RemoteException- if unable to export a remote object to the RMI system.
-
UserContext
public UserContext(String name) throws RemoteException Construct a new user context with the user name.- Parameters:
name- The name identitfying the user.- Throws:
RemoteException- if a networking issue is encountered.
-
-
Method Details
-
getInformationService
Gets a foundation Information Service.- Returns:
- Information Service.
- Throws:
ServiceException- if unable to obtain an information service.
-
getUserService
Gets a foundation User Service.- Returns:
- User Service.
- Throws:
ServiceException- if unable to obtain a user service.
-
getUserService
- Throws:
ServiceException
-
destroy
public void destroy() throws RemoteExceptionDestroy the user context. Release all resources in use.- Specified by:
destroyin interfaceUserContextInterface- Throws:
RemoteException- if a networking issue is encountered.
-
getName
public String getName() throws RemoteExceptionGet the user name. The name may be set by an application or by a login module, if it can determine it during the authentication process. This should be the name the user is commonly known by.- Specified by:
getNamein interfaceUserContextInterface- Returns:
- The user name.
- Throws:
RemoteException- if a networking issue is encountered.
-
getPersonFQID
public String getPersonFQID() throws RemoteExceptionDescription copied from interface:UserContextInterfaceGet the FQID of the authenticated Identity. This may actually be a Person or an IdentityGroup, if group logins are enabled.- Specified by:
getPersonFQIDin interfaceUserContextInterface- Returns:
- The FQID of the authenticated user.
- Throws:
RemoteException- In the event of remote object failure.
-
getDescription
public String getDescription() throws RemoteExceptionDescription copied from interface:UserContextInterfaceGet the common description for this user. This should come from the repository that the user's global profile is defined in. As a fallback, it will get the description from the primary authentication repository (in case they're different).- Specified by:
getDescriptionin interfaceUserContextInterface- Returns:
- A String with a description of the user.
- Throws:
RemoteException- in the event of remote object failure.
-
getAppSource
public final String getAppSource() throws RemoteExceptionDescription copied from interface:UserContextInterfaceGet the name of the application that initiated the login request for this UserContext.- Specified by:
getAppSourcein interfaceUserContextInterface- Returns:
- The application source identifier.
- Throws:
RemoteException- In the event of remote object failure.
-
getClientSource
public final String getClientSource() throws RemoteExceptionDescription copied from interface:UserContextInterfaceGet the client location idetifier where the login request originated.- Specified by:
getClientSourcein interfaceUserContextInterface- Returns:
- The client identifier (usually a TCP/IP address) where the login request originated for this UserContext.
- Throws:
RemoteException- In the event of remote object failure.
-
setAppSource
public void setAppSource(String source) throws RemoteException Description copied from interface:UserContextInterfaceSet the application source identifier that initiated the logon request for this UserContext.- Specified by:
setAppSourcein interfaceUserContextInterface- Parameters:
source- The application source that requested the creation of the UserContext. This is usualy either the main Java class name, or an identifiable application name.- Throws:
RemoteException- In the event of remote object failure.
-
setClientSource
public void setClientSource(String source) throws RemoteException Description copied from interface:UserContextInterfaceSet the source location identifier for this UserContext.- Specified by:
setClientSourcein interfaceUserContextInterface- Parameters:
source- The source location identifier (usually a TCP/IP address).- Throws:
RemoteException- In the event of remote object failure.
-
setSessionContext
Set the session context that this user context will use for logging, etc.- Specified by:
setSessionContextin interfaceUserContextInterface- Parameters:
session- The session context.- Throws:
RemoteException- in the event of network failure.
-
getSessionContext
Get the session context for this user.- Specified by:
getSessionContextin interfaceUserContextInterface- Returns:
- The session context.
- Throws:
RemoteException- in the event of network failure.
-
setName
public void setName(String name) throws RemoteException Set the user name.- Specified by:
setNamein interfaceUserContextInterface- Parameters:
name- The new name.- Throws:
RemoteException- if a networking issue is encountered.
-
getKey
public String getKey() throws RemoteExceptionGet the user key. This is probably a repository ID, a UUID, or some other unique identitfier for this user. Since names aren't always unique, this is necessary to uniquely locate a user context from the user service.- Specified by:
getKeyin interfaceUserContextInterface- Returns:
- A unique identifier for this user.
- Throws:
RemoteException- if a networking issue is encountered.
-
setKey
public void setKey(String key) throws RemoteException Set the user key. This should be unique within the context of the user service. The key can only be set once. After it's set, the method will return without changing the key.- Specified by:
setKeyin interfaceUserContextInterface- Parameters:
key- The key that identifies this user.- Throws:
RemoteException- if a networking issue is encountered.
-
getIDPropagation
Description copied from interface:UserContextInterfaceIf the UserContext was authenticated using an ID propagation mechanism such as SSPI, the name of the ID propagation mechanism is returned. Otherwise,nullis returned- Specified by:
getIDPropagationin interfaceUserContextInterface- Returns:
- the name of the ID propagation mechanism used to authenticate this UserContext, if any.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.- See Also:
-
addIdentity
Adds a new authentication identity to this user context.- Specified by:
addIdentityin interfaceUserContextInterface- Parameters:
identity- The new identity to add to this context.- Throws:
RemoteException- if a networking issue is encountered.
-
addUserIdentityListener
- Specified by:
addUserIdentityListenerin interfaceUserContextInterface
-
removeIdentity
Remove an identity from the context.- Specified by:
removeIdentityin interfaceUserContextInterface- Parameters:
identity- The identity to remove.
-
getIdentities
public List getIdentities() throws RemoteExceptionGet an Iterator of the identities which exist for this user context. If the current user context (set by a Subject.doAs() call) is not the same as the Subject in the LoginContext, the user has to have a CredentialPermission granted.- Specified by:
getIdentitiesin interfaceUserContextInterface- Returns:
- An Iterator of UserIdentityInterface objects.
- Throws:
RemoteException- if a networking issue is encountered.
-
getIdentityByDomain
Get an identity by domain.- Specified by:
getIdentityByDomainin interfaceUserContextInterface- Parameters:
domain- The domain to search for in the identities.- Returns:
- An identity matching the domain requested.
- Throws:
RemoteException- if a networking issue is encountered.
-
getIdentityByDomain
public UserIdentityInterface getIdentityByDomain(String domain, boolean issueChallenge) throws RemoteException, ServiceException Get an identity by domain.- Specified by:
getIdentityByDomainin interfaceUserContextInterface- Parameters:
domain- The domain to search for in the identities.issueChallenge- If true, the callback handler set in the User Service will be used to challenge the user to provide the requested credentials.- Returns:
- An identity matching the domain requested.
- Throws:
RemoteException- if a networking issue is encountered.ServiceException- if unable to obtain the identity by domain.
-
getIdentityByDomain
public UserIdentityInterface getIdentityByDomain(String domain, boolean issueChallenge, String prompt) throws RemoteException, ServiceException Gets a user identify by domain.- Specified by:
getIdentityByDomainin interfaceUserContextInterface- Parameters:
domain- Authentication domainissueChallenge-trueif a challenge should be issued.prompt- Challenge prompt- Returns:
- User identity or
nullif an idenity was not found. - Throws:
RemoteException- if a networking issue is encountered.ServiceException- if unable to obtain the identity by domain.
-
getIdentitiesByDomain
public List getIdentitiesByDomain(String domain, boolean issueChallenge, String challengePrompt) throws RemoteException, ServiceException This method returns a list of all the credential sets that are available for the requested domain.- Specified by:
getIdentitiesByDomainin interfaceUserContextInterface- Parameters:
domain- The Authentication Domain to get credentials for.issueChallenge- If true, if the user currently doesn't have credentials for the requested authentication domain, a challenge is issued back to the user for them.challengePrompt- A string to present to the user with the challenge.- Returns:
- A List of UserIdentityInterface objects with the credential sets for the requested domain. If no credentials for the domain exist, and none are returned from the challenge, an empty list is returned.
- Throws:
RemoteException- In the event of remote object failure.ServiceException- If a service error occurs.
-
addRepositoryGroup
Description copied from interface:UserContextInterfaceAdd a repository group to this UserContext. A repository group is a list of names of repositories to use for a search. They need not all be the same type of repository. That is, you may have OMR repositories and DAV repositories in the same group, if it makes sense to search both for some types of data. The group must have a name (non-null, and one or more characters), and must be unique for the groups managed by this UserContext. To perform a search using a group, callInformationServiceInterface.searchGroupName(UserContextInterface, String, com.sas.services.information.FilterInterface), orInformationServiceInterface.searchGroupNameWithFilterArray(UserContextInterface, String, com.sas.services.information.FilterInterface[]).- Specified by:
addRepositoryGroupin interfaceUserContextInterface- Parameters:
group- The repository group to add.- Throws:
ServiceException- If the group name is null, or if a group with the same name already exists in the UserContext.RemoteException- In the event of remote object failure.
-
removeRepositoryGroup
Description copied from interface:UserContextInterfaceRemove a repository group from this UserContext.- Specified by:
removeRepositoryGroupin interfaceUserContextInterface- Parameters:
group- The Group to remove.- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getRepositoryGroup
Description copied from interface:UserContextInterfaceGet a repository group from this UserContext. To perform a search using the returned group, callInformationServiceInterface.searchGroup(UserContextInterface, com.sas.services.information.RepositoryGroup, com.sas.services.information.FilterInterface), orInformationServiceInterface.searchGroupWithFilterArray(UserContextInterface, com.sas.services.information.RepositoryGroup, com.sas.services.information.FilterInterface[]).- Specified by:
getRepositoryGroupin interfaceUserContextInterface- Parameters:
name- The name of the group to return.- Returns:
- The repository group specfied by name, or null if one by that name doesn't exist.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getProfile
Get the User's profile context.- Specified by:
getProfilein interfaceUserContextInterface- Returns:
- The profile context for the user.
- Throws:
RemoteException- in a networking issue is encountered.
-
addServer
Description copied from interface:UserContextInterfaceAdd a server to the list that this user is connected to.- Specified by:
addServerin interfaceUserContextInterface- Parameters:
server- A server to which this user has an active connection.- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
removeServer
Description copied from interface:UserContextInterfaceRemove a server from the list that this user is currently connected to.- Specified by:
removeServerin interfaceUserContextInterface- Parameters:
server- The server to remove from the active list.- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getServer
Description copied from interface:UserContextInterfaceGet a specific named Information Service server from this user.- Specified by:
getServerin interfaceUserContextInterface- Parameters:
name- The configured name of the server to get from the connected list.- Returns:
- The
ServerInterfacewith the requested name, or null if it's not connected. - Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getServers
public List getServers() throws RemoteExceptionDescription copied from interface:UserContextInterfaceGet a List of the servers this user is connected to.- Specified by:
getServersin interfaceUserContextInterface- Returns:
- A List of
ServerInterfaceobjects this user has connections to. - Throws:
RemoteException- In the event of remote object failure.
-
addRepository
public void addRepository(Object repository) throws RemoteException Add a repository to this user context.- Specified by:
addRepositoryin interfaceUserContextInterface- Parameters:
repository- A connected repository that uses an identity for this user- Throws:
RemoteException- in a networking issue is encountered.
-
removeRepository
public void removeRepository(Object repository) throws RemoteException Remove a repository from this context.- Specified by:
removeRepositoryin interfaceUserContextInterface- Parameters:
repository- The repository to remove from this context.- Throws:
RemoteException- in a networking issue is encountered.
-
getRepository
Gets the repository for the specified name.- Specified by:
getRepositoryin interfaceUserContextInterface- Parameters:
name- Repository's name.- Returns:
- Repository or
nullif a repository could not be located for the specified name. - Throws:
RemoteException- if a networking issue is encountered.ServiceException- if unable to obtain a repository.
-
getAuthRepositoryName
Description copied from interface:UserContextInterfaceGet the Information Service configured name of the repository that was used for authentication. It's possible for a configuration to authenticate against multiple services. This will return the first server that was used to authenticate the user.- Specified by:
getAuthRepositoryNamein interfaceUserContextInterface- Returns:
- The name of the repository that was used for authentication.
- Throws:
ServiceException- in the event of a service failure.RemoteException- in the event of a network failure.
-
getAuthRepository
Description copied from interface:UserContextInterfaceGet a handle to the repository the user authenticated against. It's possible for a configuration to authenticate against multiple services. This will return the first server that was used to authenticate the user.- Specified by:
getAuthRepositoryin interfaceUserContextInterface- Returns:
- The RepositoryInterface used for authentication.
- Throws:
ServiceException- in the event of a service failure.RemoteException- in the event of a network failure.
-
getAuthServer
Description copied from interface:UserContextInterfaceGet a handle to the metadata server the user authenticated against.- Specified by:
getAuthServerin interfaceUserContextInterface- Returns:
- The ServerInterface that the user authenticated against.
- Throws:
ServiceException- If a server error occurs.RemoteException- In the event of remote object failure.
-
getAuthServerName
Description copied from interface:UserContextInterfaceGet the definition name of the server the user authenticated against.- Specified by:
getAuthServerNamein interfaceUserContextInterface- Returns:
- The Information Service configured Server definition name of the server that the user authenticated against.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getRepositories
public List getRepositories() throws RemoteExceptionGet an iterator of the repositories this user is connected to.- Specified by:
getRepositoriesin interfaceUserContextInterface- Returns:
- The connected repositories
- Throws:
RemoteException- in a networking issue is encountered.
-
refreshRepositoryData
Description copied from interface:UserContextInterfaceRefresh all of the data that's been retrieved using the Information Service during the life of this UserContext. This is potentially a very expensive operation, so use it with care.- Specified by:
refreshRepositoryDatain interfaceUserContextInterface- Throws:
ServiceException- If an exception occurs during the refresh operation.RemoteException- In the event of remote object failure.
-
equals
public boolean equals(Object o) Test against another object for equality. If it's a UserContextInterface and the keys match, then they're equal.- Overrides:
equalsin classRemoteObject- Parameters:
o- An object to test against this one for equality.- Returns:
- true if the objects are equal, false otherwise.
-
getPrincipals
public Set getPrincipals() throws RemoteExceptionGets the set of principals.- Specified by:
getPrincipalsin interfaceUserContextInterface- Returns:
- Set of principals.
- Throws:
RemoteException- if a networking issue is encountered.
-
getPublicCredentials
public Set getPublicCredentials() throws RemoteExceptionGets the set of public credentials.- Specified by:
getPublicCredentialsin interfaceUserContextInterface- Returns:
- Set of public credentials.
- Throws:
RemoteException- if a networking issue is encountered.
-
getPrivateCredentials
public Set getPrivateCredentials() throws RemoteExceptionGets the set of private credentials.- Specified by:
getPrivateCredentialsin interfaceUserContextInterface- Returns:
- Set of private credentials.
- Throws:
RemoteException- if a networking issue is encountered.
-
getLoginCallback
Get the callback handler. This is used by the Authenticator class to set information needed by the login modules to perform the authenticaton.- Specified by:
getLoginCallbackin interfaceUserContextInterface- Returns:
- Login callback handler.
- Throws:
RemoteException- in a networking issue is encountered.
-
authenticate
public boolean authenticate() throws RemoteExceptionDescription copied from interface:UserContextInterfaceAuthenticate a user based on their current OS identity.- Specified by:
authenticatein interfaceUserContextInterface- Returns:
- true if the authentication was successful, false otherwise.
- Throws:
RemoteException- In the event of remote object failure.
-
authenticate
Authenticates a user identity.- Specified by:
authenticatein interfaceUserContextInterface- Parameters:
ident- The identity to authenticate.options- Additional options for the authentication process (this may include a host and port for an authentication server and other information).- Returns:
- true if the authentication was successful, false otherwise.
- Throws:
RemoteException- in a networking issue is encountered.
-
addException
public void addException(Exception exception) throws RemoteException Adds an exception.- Specified by:
addExceptionin interfaceUserContextInterface- Parameters:
exception- Exception to add.- Throws:
RemoteException- if a networking issue is encountered.
-
clearExceptions
public void clearExceptions() throws RemoteExceptionClears the exceptions.- Specified by:
clearExceptionsin interfaceUserContextInterface- Throws:
RemoteException- if a networking issue is encountered.
-
getExceptions
public Exception[] getExceptions() throws RemoteExceptionGets the exceptions.- Specified by:
getExceptionsin interfaceUserContextInterface- Returns:
- Exceptions
- Throws:
RemoteException- if a networking issue is encountered.
-
setChallengeCallbackHandler
Set the object that will be used to handle credential challenge callbacks.- Specified by:
setChallengeCallbackHandlerin interfaceUserContextInterface- Parameters:
handler- The credential callback handler. This object will have to be an implementation of the javax.security.auth.callback.CallbackHandler interface.- Throws:
RemoteException- In the event of a remote failure.
-
getChallengeCallbackHandler
Get the object that will handle credential challenge callbacks.- Specified by:
getChallengeCallbackHandlerin interfaceUserContextInterface- Returns:
- The callback handler
- Throws:
RemoteException- in a networking issue is encountered.
-
getPerson
Description copied from interface:UserContextInterfaceReturn the IdentityInterface object that represents this user. This is the metadata object that the metadata server has determined represents the authenticated user. It may a PersonInterface or an IdentityGroupInterface object, if group logins are enabled in the UserService.- Specified by:
getPersonin interfaceUserContextInterface- Returns:
- An IdentityInterface representing this user, or null if the authenticated user has no metadata presence (a public user).
- Throws:
RemoteException- in the event of remote object failure.
-
setPerson
This method gets called by UserService as part of the UserContext initialization. Client code should not call this method.- Specified by:
setPersonin interfaceUserContextInterface- Parameters:
identity- Person's identity.- Throws:
RemoteException- In the event of remote object failure.IllegalStateException- If the identity object has already been set.
-
getUniqueId
public String getUniqueId() throws RemoteExceptionGets the unique ID associated with this user context.- Specified by:
getUniqueIdin interfaceUserContextInterface- Returns:
- User context's unique ID.
- Throws:
RemoteException- if a network exception occurs.
-
isDestroyed
public boolean isDestroyed() throws RemoteExceptionDetermines whether or not this user context has been destroyed.- Specified by:
isDestroyedin interfaceUserContextInterface- Returns:
trueif this user context has been destroyed.- Throws:
RemoteException- if a network exception occurs.
-
getLoginTime
public long getLoginTime() throws RemoteExceptionDescription copied from interface:UserContextInterfaceGet the timestamp when the user was authenticated.- Specified by:
getLoginTimein interfaceUserContextInterface- Returns:
- A long representing the login date/time.
- Throws:
RemoteException- In the event of remote object failure.
-
toString
public String toString()- Overrides:
toStringin classRemoteObject
-
toByteArray
public byte[] toByteArray() throws RemoteException- Specified by:
toByteArrayin interfaceUserContextInterface- Throws:
RemoteException
-
getLoginConfigAppName
- Throws:
ServiceExceptionRemoteException
-
getRoles
Description copied from interface:UserContextInterfaceGet a List of the roles this user is a member of.- Specified by:
getRolesin interfaceUserContextInterface- Returns:
- A List of Strings representing the role names this user is a member of.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
isInAnyRole
Description copied from interface:UserContextInterfaceCheck whether the user is a member of any of the roles in the list.- Specified by:
isInAnyRolein interfaceUserContextInterface- Parameters:
roleList- A List of Strings representing role names.- Returns:
- True if the user is a member of any roles in the list. False otherwise.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
isInRole
Description copied from interface:UserContextInterfaceCheck whether the user is a member of a given role.- Specified by:
isInRolein interfaceUserContextInterface- Parameters:
role- The role name to check for.- Returns:
- True if the user is a member of the role. False otherwise.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getActions
Description copied from interface:UserContextInterfaceGet a List of actions associated with an application that this user can perform.Note:
UserContextInterface.getGrantedApplicationActions(String...)is recommended instead of this method.- Specified by:
getActionsin interfaceUserContextInterface- Parameters:
appName- The SoftwareComponent name associated with the application.- Returns:
- A List of ApplicationAuthorizations representing the actions.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getActions
public List getActions(String appName, boolean onlyGrantedActions) throws ServiceException, RemoteException Description copied from interface:UserContextInterfaceGet a List of actions associated with an application.Note: Use
UserContextInterface.getGrantedApplicationActions(String...)(for granted actions) orApplicationInterface.getActions()(for all actions) instead of this method.- Specified by:
getActionsin interfaceUserContextInterface- Parameters:
appName- The SoftwareComponent name associated with the application.onlyGrantedActions- If true then return only the actions that are granted to this user; otherwise, return all actions.- Returns:
- A List of ApplicationAuthorizations representing the actions.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getGrantedApplicationActions
public Map<String,ApplicationAuthorization> getGrantedApplicationActions(String... applicationName) throws ServiceException, RemoteException Description copied from interface:UserContextInterfaceReturns a map of actions granted to the user for the specified application(s). The map is keyed by application action identifier. If multiple applications are specified all applications are scanned for granted actions. If the same action identifier is defined for multiple application, only the first granted action will be returned.- Specified by:
getGrantedApplicationActionsin interfaceUserContextInterface- Parameters:
applicationName- one or more application names- Returns:
- a map of actions granted to the user for the specified application(s)
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
hasCapability
public boolean hasCapability(String appName, String action) throws ServiceException, RemoteException Description copied from interface:UserContextInterfaceCheck whether this user has the capability to perform a specific action for a particular application.- Specified by:
hasCapabilityin interfaceUserContextInterface- Parameters:
appName- The SoftwareComponent name associated with the application.action- The action to perform.- Returns:
- True if the user has permission to perform the action; otherwise, false.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
isInGroup
Description copied from interface:UserContextInterfaceCheck whether the user is a member of a given group.- Specified by:
isInGroupin interfaceUserContextInterface- Parameters:
group- The group name to check for.- Returns:
- True if the user is a member of the group. False otherwise.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
isInAnyGroup
Description copied from interface:UserContextInterfaceCheck whether the user is a member of any of the groups in the list.- Specified by:
isInAnyGroupin interfaceUserContextInterface- Parameters:
groupList- A List of Strings representing group names.- Returns:
- True if the user is a member of any groups in the list. False otherwise.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getGroups
Description copied from interface:UserContextInterfaceGet a List of the groups this user is a member of.- Specified by:
getGroupsin interfaceUserContextInterface- Returns:
- A List of Strings representing the group names this user is a member of.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
requestCredentials
public com.sas.metadata.remote.MdCredential requestCredentials(String authDomain, boolean issueChallenge, String prompt) throws RemoteException, com.sas.metadata.remote.MdException - Specified by:
requestCredentialsin interfacecom.sas.metadata.remote.CredentialResolver- Throws:
RemoteExceptioncom.sas.metadata.remote.MdException
-
requestCredentialList
public List requestCredentialList(String authDomain, boolean issueChallenge, String prompt) throws RemoteException, com.sas.metadata.remote.MdException - Specified by:
requestCredentialListin interfacecom.sas.metadata.remote.CredentialResolver- Throws:
RemoteExceptioncom.sas.metadata.remote.MdException
-
getResolvedUserId
Return the metadata server resolved user id.- Specified by:
getResolvedUserIdin interfaceUserContextInterface- Returns:
- the user id as resolved by the metadata server. This is a domain-qualified user id (e.g., user@DefaultAuth).
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
isInternalUser
Return a boolean indicating if this user was created using an internal userid.- Specified by:
isInternalUserin interfaceUserContextInterface- Returns:
- true if the user was created using an internal userid, false otherwise.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getLocale
Description copied from interface:UserContextInterfaceGet the locale for this user. If it has been set explicitly, return that value. If the user has a profile, return the profile setting. If there's no other locale available, return the JVM default.- Specified by:
getLocalein interfaceUserContextInterface- Returns:
- The user's current locale setting.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
enableLocalAdminMode
Description copied from interface:UserContextInterfaceThis sets up a special case where an administrative user with an internal account is used to authenticate a user. Since the internal account cannot be used to authenticate against other resources like a workspace server, this creates a problem because the UserContext won't go get other credentials in the primary authentication domain. This overrides that behavior and makes the primary credential "sticky", so it won't really be removed if requested.- Specified by:
enableLocalAdminModein interfaceUserContextInterface- Parameters:
authDomain- The domain to retrieve all credentials for. This overrides my default behavior of not getting any more credentials for the primary authentication domain.- Throws:
ServiceException- If a metadata or service-level error occurs.RemoteException- In the event of remote object failure.
-
setLocale
Description copied from interface:UserContextInterfaceSet the locale to use for this user session.- Specified by:
setLocalein interfaceUserContextInterface- Parameters:
locale- The preferred locale for this user for the live of this session.- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-