Package org.picketlink.idm.api

Examples of org.picketlink.idm.api.User


    public List<OpenIdProvider> getProviders() {
        return providers;
    }

    public void success(OpenIdPrincipal principal) {
        User user = new OpenIdUser(principal);
                       
        if (isIdentityManaged()) {
            // By default we set the status to FAILURE, if we manage to get to the end
            // of this method we get rewarded with a SUCCESS
            setStatus(AuthenticationStatus.FAILURE);       
View Full Code Here


        try {           
            // Check that the user's identity exists
            if (session.getPersistenceManager().findUser(principal.getIdentifier()) == null) {
                // The user wasn't found, let's create them
               
                User user = session.getPersistenceManager().createUser(principal.getIdentifier());
               
                // TODO allow the OpenID -> IDM attribute mapping to be configured
               
                // Map fetched attributes to identity-managed attributes for new users
                for (String alias : principal.getAttributeValues().keySet()) {
View Full Code Here

        return permissionMapper.resolvePermission(target, action);
    }

    public synchronized void runAs(RunAsOperation operation) {
        User savedUser = getUser();

        if (systemOp == null) {
            systemOp = new ThreadLocal<Boolean>();
        }
View Full Code Here

        try {
            // Check that the user's identity exists
            if (session.getPersistenceManager().findUser(principal.getId()) == null) {
                // The user wasn't found, let's create them

                User user = session.getPersistenceManager().createUser(principal.getId());

                // TODO allow the OAuth -> IDM attribute mapping to be configured
                // e.g.
                // session.getAttributesManager().addAttribute(user, "fullName", principal.getUserProfile().getFullName());
                // session.getAttributesManager().addAttribute(user, "profileImageUrl",
View Full Code Here

    @Inject
    Identity identity;

    public void authenticate() {
        if (identitySession != null) {
            User u = new SimpleUser(credentials.getUsername());

            try {
                boolean success = identitySession.getAttributesManager().validateCredentials(
                        u, new Credential[]{credentials.getCredential()});
View Full Code Here

  
   public void authenticate()
   {
      if (identitySession != null)
      {           
         User u = new UserImpl(credentials.getUsername());
        
         try
         {
            boolean success = identitySession.getAttributesManager().validateCredentials(
                  u, new Credential[] {credentials.getCredential()});
View Full Code Here

         // TODO - add control message
         //StatusMessages.instance().addToControl("password", "Passwords do not match");
         return "failure";
      }
     
      User user = identitySession.getPersistenceManager().createUser(username);
      identitySession.getAttributesManager().updatePassword(user, password);
     
      for (Role role : roles)
      {
         identitySession.getRoleManager().createRole(role.getRoleType(), user, role.getGroup());
View Full Code Here

      return "success";
   }
  
   private String saveExistingUser() throws IdentityException, FeatureNotSupportedException
   {
      User user = identitySession.getPersistenceManager().findUser(username);     
     
      // Check if a new password has been entered
      if (password != null && !"".equals(password))
      {
         if (!password.equals(confirm))
View Full Code Here

      return permissionMapper.resolvePermission(target, action);
   }
  
   public synchronized void runAs(RunAsOperation operation)
   {
      User savedUser = getUser();
     
      if (systemOp == null)
      {
         systemOp = new ThreadLocal<Boolean>();
      }
View Full Code Here

//        }
    }

    @Produces @Preferred @RequestScoped
    public RulesRepository getRulesRepository(RepositoryStartupService repositoryStartupService, Identity identity) {
          User user = identity.getUser();
         String username;
         // TODO user should never be null, weld messes up the identity proxy?
         if (user == null) {
             log.warn("Creating RulesRepository with default username.");
             // Do not use user name "anonymous" as this user is configured in JackRabbit SimpleLoginModule
             // with limited privileges. In Guvnor, access control is done in a higher level.
             username = DEFAULT_USERNAME;
         } else {
             username = user.getId();
         }
         doSecurityContextAssociation();
         RulesRepository rulesRepository = new RulesRepository(repositoryStartupService.newSession(username));
         return rulesRepository;     
    }
View Full Code Here

TOP

Related Classes of org.picketlink.idm.api.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.