Package com.caucho.security

Examples of com.caucho.security.BasicPrincipal


  public PasswordUser(String user,
                      char []password,
                      String []roles)
  {
    this(new BasicPrincipal(user), password, false, false, roles);
  }
View Full Code Here


  }

  public PasswordUser(String user,
                      char []password)
  {
    this(new BasicPrincipal(user), password,
         false, false, new String[] { "user" });
  }
View Full Code Here

     
      if (password != null) {
        String signed = password;
       
        if (algorithm != null && ! "".equals(uid)) {
          Principal user = new BasicPrincipal(uid);
       
          char []digest = DigestBuilder.getDigest(user,
                                                  algorithm,
                                                  password.toCharArray(),
                                                  algorithm.toCharArray());
View Full Code Here

                                           credentials));
    }
    else if (credentials instanceof DigestCredentials) {
      DigestCredentials digestCred = (DigestCredentials) credentials;

      Principal user = new BasicPrincipal(digestCred.getUserName());
     
      user = auth.authenticate(user, digestCred, null);

      if (user == null) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid digest credentials",
                                             digestCred.getUserName()));
      }
    }
    else if (credentials instanceof String) {
      String password = (String) credentials;
   
      Principal user = new BasicPrincipal(to);
      PasswordCredentials pwdCred = new PasswordCredentials(password);
   
      if (auth.authenticate(user, pwdCred, null) == null) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid password credentials",
                                             to));
View Full Code Here

  public void setRunAs(RunAs runAs)
  {
    String roleName = runAs.getRoleName();

    if (roleName != null)
      _runAs = new BasicPrincipal(roleName);
  }
View Full Code Here

      throw new IllegalArgumentException();

    if (! _webApp.isInitializing())
      throw new IllegalStateException();

    _runAs = new BasicPrincipal(roleName);
  }
View Full Code Here

      if (_name == null)
        throw new ConfigException(L.l("management <user> requires a 'name' attribute"));

      boolean isAnonymous = false;

      return new PasswordUser(new BasicPrincipal(_name),
                              _password.toCharArray(),
                              _isDisabled, isAnonymous,
                              new String[] { "resin-admin" });
    }
View Full Code Here

    public void setName(String name)
    {
      _name = name;

      if (_principal == null)
  _principal = new BasicPrincipal(name);
    }
View Full Code Here

  @Override
  protected Principal authenticate(Principal user,
           PasswordCredentials cred,
           Object details)
  {
    return new BasicPrincipal(user.getName());
  }
View Full Code Here

      }

      if (roles == null)
  roles = new String[] { "user" };
     
      Principal principal = new BasicPrincipal(userName);

      boolean isDisabled = false;
      boolean isAnonymous = false;
     
      return new PasswordUser(principal, ldapPassword.toCharArray(),
View Full Code Here

TOP

Related Classes of com.caucho.security.BasicPrincipal

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.