Examples of MyPrincipal


Examples of org.apache.wicket.security.examples.authorization.MyPrincipal

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

Examples of org.apache.wicket.security.examples.authorization.MyPrincipal

    if (username != null && Objects.equal(username, password))
    {
      DefaultSubject subject = new DefaultSubject();
      if ("ceo".equals(username))
      {
        subject.addPrincipal(new MyPrincipal("organisation.rights"));
      }
      else
        subject.addPrincipal(new MyPrincipal("department.rights"));
      return subject;
    }
    throw new LoginException("Username and password do not match any known user.");
  }
View Full Code Here

Examples of org.apache.wicket.security.examples.authorization.MyPrincipal

      // Note if topsecret implied basic we would not have to add it here.
      // 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

Examples of org.apache.wicket.security.examples.authorization.MyPrincipal

    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

Examples of org.apache.wicket.security.examples.authorization.MyPrincipal

  {
    // 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

Examples of org.apache.wicket.security.examples.authorization.MyPrincipal

  {
    // 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.