Package org.wicketstuff.security.authentication

Examples of org.wicketstuff.security.authentication.LoginException


   * @see LoginContext#login()
   */
  public void login(LoginContext context) throws LoginException
  {
    if (preventsLogin != null)
      throw new LoginException("Additional Logins are not allowed");
    if (context == null)
      throw new LoginException("Context is required to login.");
    HashKey key = new HashKey(context);
    if (subjects.containsKey(key))
      throw new LoginException("Already logged in through this context ").setLoginContext(context);
    Subject mySubject;
    mySubject = context.login();
    if (mySubject == null)
      throw new LoginException("Login failed ").setLoginContext(context);
    mySubject.setReadOnly();
    if (key.preventsAdditionalLogins())
      preventsLogin = key;
    subjects.put(key, mySubject);
    logins.add(key);
View Full Code Here


      return false;
    }
    byte[] decoded = Base64.decodeBase64(param.getBytes());
    String[] split = new String(decoded).split(":");
    if (split == null || split.length != 2)
      throw new LoginException("Could not decrypt username / password");
    Object loginContext = getBasicLoginContext(split[0], split[1]);
    Session session = Session.get();
    if (session instanceof WaspSession)
    {
      if (!isAuthenticated())
View Full Code Here

    {
      loggedin = true;
      authorized.putAll((Map<String, WaspAction>)context);
    }
    else
      throw new LoginException(
        "Specify a map containing all the classes/components and what actions are authorized");
  }
View Full Code Here

   */
  @Override
  public final Subject login() throws LoginException
  {
    if (username == null || password == null)
      throw new LoginException("Insufficient information to login");
    Subject subject = getSubject(username, password);
    username = null;
    password = null;
    return subject;
  }
View Full Code Here

TOP

Related Classes of org.wicketstuff.security.authentication.LoginException

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.