Package org.apache.shiro.authc

Examples of org.apache.shiro.authc.SimpleAuthenticationInfo


    if (user == null) {
      throw new AuthenticationException("Invalid username '" + userId + "'");
    }

    return new SimpleAuthenticationInfo(user.getUserId(), user.getPassword(), getName());
  }
View Full Code Here


  @Override
  protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
      throws AuthenticationException
  {
    if (this.userPrivileges.containsKey(token.getPrincipal().toString())) {
      return new SimpleAuthenticationInfo(token.getPrincipal().toString(), token.getCredentials(), this.getName());
    }

    return null;
  }
View Full Code Here

    }

    try {
      this.ldapManager.authenticateUser(username, pass);
      // creating AuthInfo with plain pass (relates to creds matcher too)
      return new SimpleAuthenticationInfo(username, pass.toCharArray(), getName());
    }
    catch (org.sonatype.security.authentication.AuthenticationException e) {
      if (this.logger.isDebugEnabled()) {
        this.logger.debug("User: " + username + " could not be authenticated ", e);
      }
View Full Code Here

      log.debug("Found principals for RUT user '{}': '{}' from realms '{}'", rutUserId, principals,
          principals.getRealmNames());
      // make RUT the primary one, but keep all the found ones too
      final SimplePrincipalCollection principalCollection = new SimplePrincipalCollection(token.getPrincipal(), getName());
      principalCollection.addAll(principals);
      return new SimpleAuthenticationInfo(principalCollection, null);
    }
    log.debug("No found principals for RUT user '{}'", rutUserId);
    return null;
  }
View Full Code Here

          + "\" cannot be authenticated via Kenai Realm.");
    }
  }

  private AuthenticationInfo buildAuthenticationInfo(final UsernamePasswordToken token) {
    return new SimpleAuthenticationInfo(token.getPrincipal(), token.getCredentials(), getName());
  }
View Full Code Here

  protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
      throws AuthenticationException
  {
    UsernamePasswordToken upToken = (UsernamePasswordToken) token;

    return new SimpleAuthenticationInfo(upToken.getUsername(), "password", getName());
  }
View Full Code Here

  protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
      throws AuthenticationException
  {
    UsernamePasswordToken upToken = (UsernamePasswordToken) token;

    return new SimpleAuthenticationInfo(upToken.getUsername(), "password", getName());
  }
View Full Code Here

    // only allow jcoder/jcoder

    UsernamePasswordToken userpass = (UsernamePasswordToken) token;
    if ("jcoder".equals(userpass.getUsername()) && "jcoder".equals(new String(userpass.getPassword()))) {
      return new SimpleAuthenticationInfo(userpass.getUsername(), new String(userpass.getPassword()),
          this.getName());
    }

    return null;
  }
View Full Code Here

    // only allow jcool/jcool

    UsernamePasswordToken userpass = (UsernamePasswordToken) token;
    if ("jcool".equals(userpass.getUsername()) && "jcool".equals(new String(userpass.getPassword()))) {
      return new SimpleAuthenticationInfo(userpass.getUsername(), new String(userpass.getPassword()),
          this.getName());
    }

    return null;
  }
View Full Code Here

    if (!publicKeyRepository.hasAccount(principal)) {
      return null;
    }

    return new SimpleAuthenticationInfo(principal, publicKeyRepository.getPublicKeys(principal), getName());
  }
View Full Code Here

TOP

Related Classes of org.apache.shiro.authc.SimpleAuthenticationInfo

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.