aerogear-security-picketlink 1.2.0

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)
           
 org.picketlink.idm.model.sample.User findById(long id)
           
 org.picketlink.idm.model.sample.User findByUsername(String username)
           
 String getLogin()
           
 String getSecret()
          Represents the generated 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)
           
 
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.

findByUsername

public org.picketlink.idm.model.sample.User findByUsername(String username)
                                                    throws RuntimeException
Specified by:
findByUsername in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Throws:
RuntimeException

remove

public void remove(String username)
Specified by:
remove in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>

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 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()
Specified by:
getLogin in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>

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
Specified by:
findById in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>
Throws:
RuntimeException

findAllByRole

public List<org.picketlink.idm.model.sample.User> findAllByRole(String name)
Specified by:
findAllByRole in interface org.jboss.aerogear.security.authz.IdentityManagement<org.picketlink.idm.model.sample.User>

aerogear-security-picketlink 1.2.0

Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.