aerogear-security-picketlink 1.2.1

org.jboss.aerogear.security.picketlink.authz
Class IdentityManagementImpl

java.lang.Object
  extended by org.jboss.aerogear.security.picketlink.authz.IdentityManagementImpl
All Implemented Interfaces:
org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>

@ApplicationScoped
public class IdentityManagementImpl
extends Object
implements org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>

IdentityManagement allows to assign a set of roles to User on Identity Manager provider


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.aerogear.security.authz.IdentityManagement
org.jboss.aerogear.security.authz.IdentityManagement.GrantMethods<T>
 
Constructor Summary
IdentityManagementImpl()
           
 
Method Summary
 void create(org.picketlink.idm.model.sample.User user, String password)
          This method creates a new User
 List<org.picketlink.idm.model.sample.User> findAllByRole(String name)
          Get All the users
 org.picketlink.idm.model.sample.User findById(long id)
          Find an User by the id specified
 org.picketlink.idm.model.sample.User findByUsername(String username)
          Find an User by the username specified
 String getLogin()
          Retrieve the logged user name
 String getSecret()
          Represents the generated TOTP secret for the current User logged in.
 org.jboss.aerogear.security.authz.IdentityManagement.GrantMethods grant(String... roles)
          This method allows to specify which roles must be assigned to User
 boolean hasRoles(Set<String> roles)
          Role validation against the IDM
 void remove(String username)
          Remove an User
 void reset(org.picketlink.idm.model.sample.User user, String currentPassword, String newPassword)
          Reset user' password
 org.jboss.aerogear.security.authz.IdentityManagement.GrantMethods revoke(String... roles)
          This method allows to revoke which roles must be revoked to User
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityManagementImpl

public IdentityManagementImpl()
Method Detail

grant

public org.jboss.aerogear.security.authz.IdentityManagement.GrantMethods grant(String... roles)
This method allows to specify which roles must be assigned to User

Specified by:
grant in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
roles - The list of roles.
Returns:
GrantMethods is a builder which a allows to apply a list of roles to the specified User.

revoke

public org.jboss.aerogear.security.authz.IdentityManagement.GrantMethods revoke(String... roles)
This method allows to revoke which roles must be revoked to User

Specified by:
revoke in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
roles - The list of roles.
Returns:
GrantMethods is a builder which a allows to revoke a list of roles to the specified User.

findByUsername

public org.picketlink.idm.model.sample.User findByUsername(String username)
                                                    throws RuntimeException
Find an User by the username specified

Specified by:
findByUsername in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
username -
Returns:
User
Throws:
RuntimeException

remove

public void remove(String username)
Remove an User

Specified by:
remove in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
username -

reset

public void reset(org.picketlink.idm.model.sample.User user,
                  String currentPassword,
                  String newPassword)
Reset user' password

Specified by:
reset in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
user - User credential
currentPassword - current password already registered
newPassword - new password
Throws:
Exception

create

public void create(org.picketlink.idm.model.sample.User user,
                   String password)
This method creates a new User

Specified by:
create in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
user -

getSecret

@Produces
@Secret
public String getSecret()
Represents the generated TOTP secret for the current User logged in.

Specified by:
getSecret in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>

getLogin

@Produces
@LoggedUser
public String getLogin()
Retrieve the logged user name

Specified by:
getLogin in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Returns:
user name

hasRoles

public boolean hasRoles(Set<String> roles)
Role validation against the IDM

Specified by:
hasRoles in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
roles - roles to be checked
Returns:
returns true if the current logged in has roles at the IDM, false otherwise

findById

public org.picketlink.idm.model.sample.User findById(long id)
                                              throws RuntimeException
Find an User by the id specified

Specified by:
findById in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
id -
Returns:
User
Throws:
RuntimeException

findAllByRole

public List<org.picketlink.idm.model.sample.User> findAllByRole(String name)
Get All the users

Specified by:
findAllByRole in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Parameters:
name - Role name
Returns:
Users by roles

aerogear-security-picketlink 1.2.1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.