public interface IPrincipalData
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();
Modifier and Type | Field and Description |
---|---|
static String |
ID
the default ID to use for this bean
|
Modifier and Type | Method and Description |
---|---|
String |
getDN()
Retrieve the DN for this AuthInfo.
|
String |
getDomain()
Get the domain.
|
String |
getDomainUserName()
Get the username for this AuthInfo
|
String |
getPassword()
Deprecated.
do not use
|
String |
getUri()
Retrieve the
IURI for this principal. |
IURI |
getUserDirectoryURI()
Lookup the Directory uri from the DirProvider
|
IThingID |
getUserID() |
String |
getUserName()
Get the username for this AuthInfo.
|
boolean |
isAdminSession()
Determine if this user is an Administrator.
|
boolean |
isAnonymous()
Determine if current user is a guest/anonymous user.
|
boolean |
isAuthenticated()
Determines if this user is authenticated.
|
boolean |
isLoginSession()
Deprecated.
|
boolean |
isPrivilegedInfo()
Retrieve the privileged info flag
That signals the login attempts should use the loginNoAuth option
|
void |
setAuthentication(boolean isAuthenticated)
Set the auth validation flag
|
void |
setDN(String dn)
Set the DN for this AuthInfo
|
void |
setDomain(String domain)
Sets the domain
|
void |
setInfo(String username,
String password,
String domain,
String authType)
Sets a vareity of run-time information about the current user.
|
void |
setIsAdminSession(boolean isAdminSession)
Set the Admin session flag
|
void |
setIsAnonymous(boolean isAnonymous)
Set the anonymous flag for the current user.
|
void |
setIsLoginSession(boolean isLoginSession)
Deprecated.
for internal use only
|
void |
setIsPrivilegedInfo(boolean isPrivilegedInfo)
Set the privileged info flag
That signals the login attempts should use the loginNoAuth option
|
void |
setUri(String uri)
Set the URI for this AuthInfo
|
void |
setUserID(IThingID userID) |
void |
setUserName(String userName)
Sets the username for this AuthInfo
|
static final String ID
void setInfo(String username, String password, String domain, String authType)
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.)String getUri()
IURI
for this principal.
This can later be used to reference the Directory or MetaData representation of the principal.void setUri(String uri)
uri
- the URI to setgetUri()
String getDN()
void setDN(String dn)
dn
- the DN to setgetDN()
String getUserName()
void setUserName(String userName)
userName
- the usernamesetUserName(java.lang.String)
@Deprecated String getPassword()
String getDomain()
void setDomain(String domain)
getDomain()
void setAuthentication(boolean isAuthenticated)
isAuthenticated
- if true, indicates this AuthInfo is validated, false otherwiseboolean isAuthenticated()
void setIsAdminSession(boolean isAdminSession)
isAdminSession
- if true indicates this AuthInfo represents an Administrator, false otherwiseboolean isAdminSession()
void setIsAnonymous(boolean isAnonymous)
isAnonymous
- true if this is an anonymous session, false otherwiseboolean isAnonymous()
@Deprecated void setIsLoginSession(boolean isLoginSession)
isLoginSession
- true if this is a login session, false otherwise@Deprecated boolean isLoginSession()
boolean isPrivilegedInfo()
void setIsPrivilegedInfo(boolean isPrivilegedInfo)
isPrivilegedInfo
- true if this signals the loginNoAuth option (default is false)IURI getUserDirectoryURI() throws PortalException
PortalException
void setUserID(IThingID userID)
userID
- getUserID()
String getDomainUserName()