Package org.apache.wicket.security.hive.authentication

Examples of org.apache.wicket.security.hive.authentication.DefaultSubject.addPrincipal()


      // Also we only need this because we can login through a
      // bookmarkable url, thereby bypassing the first login page.
      // if we know we always come through the first loginpage we can
      // remove basic here.
      subject.addPrincipal(new MyPrincipal("basic"));
      subject.addPrincipal(new MyPrincipal("topsecret"));
      return subject;
    }
    throw new LoginException("username does not match token");
  }
View Full Code Here


    if (Objects.equal(username, password))
    {
      // usually there will be a db call to verify the credentials
      DefaultSubject subject = new MyPrimarySubject();
      // add principals as required, usually these come from a db
      subject.addPrincipal(new MyPrincipal("basic"));
      return subject;
    }
    throw new LoginException("username does not match password");
  }
View Full Code Here

  {
    // username password combo is already verified, just get the user object
    // and create a subject for it
    // getting the user object is being skipped in this example
    DefaultSubject subject = new DefaultSubject();
    subject.addPrincipal(new MyPrincipal("digest"));
    return subject;
  }

}
View Full Code Here

  {
    // irrelevant check
    if (username != null && Objects.equal(username, password))
    {
      DefaultSubject subject = new DefaultSubject();
      subject.addPrincipal(new MyPrincipal("basic"));
      return subject;
    }
    throw new LoginException("Username and password do not match any known user.");
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.