|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.seam.security.IdentityImpl
@Named(value="identity") @SessionScoped public class IdentityImpl
Identity implementation for authentication and authorization
| Field Summary | |
|---|---|
protected static boolean |
securityEnabled
|
| Fields inherited from interface org.jboss.seam.security.Identity |
|---|
RESPONSE_LOGIN_EXCEPTION, RESPONSE_LOGIN_FAILED, RESPONSE_LOGIN_SUCCESS |
| Constructor Summary | |
|---|---|
IdentityImpl()
|
|
| Method Summary | |
|---|---|
boolean |
addGroup(String name,
String groupType)
Adds the user to the specified group. |
boolean |
addRole(String roleType,
String group,
String groupType)
Adds a role to the authenticated user. |
protected boolean |
authenticate()
|
void |
checkGroup(String group,
String groupType)
|
void |
checkPermission(Object target,
String action)
Checks if the currently authenticated user has the specified permission for the specified resource. |
void |
checkRestriction(String expr)
Performs an authorization check, based on the specified security expression string. |
void |
checkRole(String roleType,
String group,
String groupType)
Checks that the current authenticated user is a member of the specified role. |
protected void |
deferredAuthenticationObserver(DeferredAuthenticationEvent event)
|
void |
filterByPermission(Collection<?> collection,
String action)
Filters a collection of objects by a specified action, by removing the objects from the collection for which the user doesn't have the necessary privileges to perform the specified action against that object. |
Class<Authenticator> |
getAuthenticatorClass()
|
String |
getAuthenticatorName()
|
Set<org.picketlink.idm.api.Group> |
getGroups()
Returns an immutable set containing all the current user's group memberships |
Set<org.picketlink.idm.api.Role> |
getRoles()
Returns an immutable set containing all the current user's granted roles |
org.picketlink.idm.api.User |
getUser()
Returns the currently authenticated user |
boolean |
hasPermission(Object target,
String action)
Checks if the currently authenticated user has the necessary permission for a specific resource. |
boolean |
hasRole(String roleType,
String group,
String groupType)
Checks if the authenticated user is a member of the specified role. |
boolean |
inGroup(String name,
String groupType)
Checks if the authenticated user is a member of the specified group |
boolean |
isLoggedIn()
Simple check that returns true if the user is logged in, without attempting to authenticate |
static boolean |
isSecurityEnabled()
|
boolean |
isVerified()
Returns true if the currently authenticated user has provided their correct credentials within the verification window configured by the application. |
String |
login()
Performs an authorization check, based on the specified security expression string. |
void |
logout()
Logs out the currently authenticated user |
protected Authenticator |
lookupAuthenticator()
Returns an Authenticator instance to be used for authentication. |
protected void |
postAuthenticate()
|
protected void |
preAuthenticate()
Clears any roles added by calling addRole() while not authenticated. |
void |
quietLogin()
Attempts a quiet login, suppressing any login exceptions and not creating any faces messages. |
void |
removeGroup(String name,
String groupType)
Removes the currently authenticated user from the specified group |
void |
removeRole(String roleType,
String group,
String groupType)
Removes a role from the authenticated user |
void |
runAs(RunAsOperation operation)
|
void |
setAuthenticatorClass(Class<Authenticator> authenticatorClass)
|
void |
setAuthenticatorName(String authenticatorName)
|
static void |
setSecurityEnabled(boolean enabled)
|
boolean |
tryLogin()
Will attempt to authenticate quietly if the user's credentials are set and they haven't authenticated already. |
void |
unAuthenticate()
Resets all security state and credentials |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static boolean securityEnabled
| Constructor Detail |
|---|
public IdentityImpl()
| Method Detail |
|---|
public static boolean isSecurityEnabled()
public static void setSecurityEnabled(boolean enabled)
public boolean isLoggedIn()
Identity
isLoggedIn in interface Identitypublic Class<Authenticator> getAuthenticatorClass()
getAuthenticatorClass in interface Identitypublic void setAuthenticatorClass(Class<Authenticator> authenticatorClass)
setAuthenticatorClass in interface Identitypublic String getAuthenticatorName()
getAuthenticatorName in interface Identitypublic void setAuthenticatorName(String authenticatorName)
setAuthenticatorName in interface Identitypublic boolean tryLogin()
Identity
tryLogin in interface Identitypublic String login()
login in interface Identityexpr - The security expression string to evaluate
NotLoggedInException - Thrown if the authorization check fails and
the user is not authenticated
AuthorizationException - Thrown if the authorization check fails and
the user is authenticatedpublic void quietLogin()
Identity
quietLogin in interface Identity
protected boolean authenticate()
throws AuthenticationException
AuthenticationExceptionprotected void preAuthenticate()
protected void deferredAuthenticationObserver(@Observes
DeferredAuthenticationEvent event)
protected void postAuthenticate()
protected Authenticator lookupAuthenticator()
throws AuthenticationException
AuthenticationExceptionpublic void unAuthenticate()
public void logout()
Identity
logout in interface Identity
public boolean hasRole(String roleType,
String group,
String groupType)
Identity
hasRole in interface IdentityroleType - String The name of the role to check
public boolean addRole(String roleType,
String group,
String groupType)
Identity
addRole in interface IdentityroleType - The name of the role to add
public boolean inGroup(String name,
String groupType)
Identity
inGroup in interface Identityname - The name of the groupgroupType - The type of the group, e.g. "office", "department", "global role", etc
public boolean addGroup(String name,
String groupType)
Identity
addGroup in interface Identityname - The name of the groupgroupType - The type of the group
public void removeGroup(String name,
String groupType)
Identity
removeGroup in interface Identityname - The name of the groupgroupType - The type of the group
public void removeRole(String roleType,
String group,
String groupType)
removeRole in interface Identityrole - The name of the role to remove
public void checkRole(String roleType,
String group,
String groupType)
Identity
checkRole in interface IdentityroleType - String The name of the role to check
public void checkGroup(String group,
String groupType)
checkGroup in interface Identity
public void checkPermission(Object target,
String action)
Identity
checkPermission in interface Identitytarget - The resource for which the user wishes to perform a restricted actionaction - The name of the permission that the user requires to invoke the operation
public void filterByPermission(Collection<?> collection,
String action)
Identity
filterByPermission in interface Identitycollection - The Collection to filter
public boolean hasPermission(Object target,
String action)
Identity
hasPermission in interface Identitypublic void runAs(RunAsOperation operation)
public void checkRestriction(String expr)
Identity
checkRestriction in interface Identityexpr - The security expression string to evaluatepublic org.picketlink.idm.api.User getUser()
Identity
getUser in interface Identitypublic Set<org.picketlink.idm.api.Role> getRoles()
Identity
getRoles in interface Identitypublic Set<org.picketlink.idm.api.Group> getGroups()
Identity
getGroups in interface Identitypublic boolean isVerified()
Identity
isVerified in interface Identity
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||