Package com.webmethods.portal.bizPolicy
Interface IPrincipalData
- All Known Implementing Classes:
AuthInfo
public interface IPrincipalData
IPrincipalData is a bean that contains some useful information regarding the current
principal associated with a portal
IContext
.
In order to obtain a reference to the current user's IPrincipalData use the following:
IPrincipalData principalData = com.webmethods.portal.bizPolicy.impl.ContextFactory.acquireContext(true);
Once you have the principalData, you can use the various bean methods to get more detailed
information about the current user. For instance:
String userDN = principalData.getDN();
String userName = principalData.getUserName();
String domain = principalData.getDomain();
boolean isAnonymous = principalData.isAnonymous();
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetDN()
Retrieve the DN for this AuthInfo.Get the domain.Get the username for this AuthInfoDeprecated.do not usegetUri()
Retrieve theIURI
for this principal.Lookup the Directory uri from the DirProviderGet the username for this AuthInfo.boolean
Determine if this user is an Administrator.boolean
Determine if current user is a guest/anonymous user.boolean
Determines if this user is authenticated.boolean
Deprecated.boolean
Retrieve the privileged info flag That signals the login attempts should use the loginNoAuth optionvoid
setAuthentication
(boolean isAuthenticated) Set the auth validation flagvoid
Set the DN for this AuthInfovoid
Sets the domainvoid
Sets a vareity of run-time information about the current user.void
setIsAdminSession
(boolean isAdminSession) Set the Admin session flagvoid
setIsAnonymous
(boolean isAnonymous) Set the anonymous flag for the current user.void
setIsLoginSession
(boolean isLoginSession) Deprecated.for internal use onlyvoid
setIsPrivilegedInfo
(boolean isPrivilegedInfo) Set the privileged info flag That signals the login attempts should use the loginNoAuth optionvoid
Set the URI for this AuthInfovoid
void
setUserName
(String userName) Sets the username for this AuthInfo
-
Field Details
-
ID
the default ID to use for this bean- See Also:
-
-
Method Details
-
setInfo
Sets a vareity of run-time information about the current user.- Parameters:
username
- the current user's useridpassword
- the user passworddomain
- the current user's domainauthType
- the type of authorization (usually the type of auth handler that accepted the auth, like 'simple', 'ntlm', 'basic', etc.)
-
getUri
String getUri()Retrieve theIURI
for this principal. This can later be used to reference the Directory or MetaData representation of the principal.- Returns:
- the URI represented by this AuthInfo object
-
setUri
Set the URI for this AuthInfo- Parameters:
uri
- the URI to set- See Also:
-
getDN
String getDN()Retrieve the DN for this AuthInfo. For instance: "o=webmethods,ou=People,uid=Portal Admin"
This information can be viewed by going to a user's Extended Profile Page- Returns:
- the DN represented by this AuthInfo object
-
setDN
Set the DN for this AuthInfo- Parameters:
dn
- the DN to set- See Also:
-
getUserName
String getUserName()Get the username for this AuthInfo. This is the user's id, or login name, not their Full name.- Returns:
- the username
-
setUserName
Sets the username for this AuthInfo- Parameters:
userName
- the username- See Also:
-
getPassword
Deprecated.do not useGet the password- Returns:
- the user password
-
getDomain
String getDomain()Get the domain. This is the name of the directory service that the user has authenticated with.- Returns:
- the user domain
-
setDomain
Sets the domain- See Also:
-
setAuthentication
void setAuthentication(boolean isAuthenticated) Set the auth validation flag- Parameters:
isAuthenticated
- if true, indicates this AuthInfo is validated, false otherwise
-
isAuthenticated
boolean isAuthenticated()Determines if this user is authenticated. This may be a named user, but not yet authenticated acting in a 'guest-like' capacity.- Returns:
- true if validated, false otherwise
-
setIsAdminSession
void setIsAdminSession(boolean isAdminSession) Set the Admin session flag- Parameters:
isAdminSession
- if true indicates this AuthInfo represents an Administrator, false otherwise
-
isAdminSession
boolean isAdminSession()Determine if this user is an Administrator.- Returns:
- true if this is an AdminSession, false otherwise
-
setIsAnonymous
void setIsAnonymous(boolean isAnonymous) Set the anonymous flag for the current user.- Parameters:
isAnonymous
- true if this is an anonymous session, false otherwise
-
isAnonymous
boolean isAnonymous()Determine if current user is a guest/anonymous user. -
setIsLoginSession
Deprecated.for internal use onlySet the login session flag- Parameters:
isLoginSession
- true if this is a login session, false otherwise
-
isLoginSession
Deprecated.Determines if the current session is a login session- Returns:
- true if this is a login session, false otherwise * @deprecated for internal use only
-
isPrivilegedInfo
boolean isPrivilegedInfo()Retrieve the privileged info flag That signals the login attempts should use the loginNoAuth option- Returns:
- isPrivilegedInfo true if this signals the loginNoAuth option (default is false)
-
setIsPrivilegedInfo
void setIsPrivilegedInfo(boolean isPrivilegedInfo) Set the privileged info flag That signals the login attempts should use the loginNoAuth option- Parameters:
isPrivilegedInfo
- true if this signals the loginNoAuth option (default is false)
-
getUserID
IThingID getUserID()- Returns:
- the
IThingID
of the current user
-
getUserDirectoryURI
Lookup the Directory uri from the DirProvider- Throws:
PortalException
-
setUserID
- Parameters:
userID
-- See Also:
-
getDomainUserName
String getDomainUserName()Get the username for this AuthInfo- Returns:
- the username
-