Examples of addPrincipal()


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

      DefaultSubject subject = new DefaultSubject();
      subject.addPrincipal(new SimplePrincipal("user"));

      if (username.equalsIgnoreCase("admin"))
      {
        subject.addPrincipal(new SimplePrincipal("admin"));
      }
      return subject;
    }
    throw new LoginException("Username and password do not match any known user.");
  }
View Full Code Here

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

  {
    // TODO verify username, password, if user is not authenticated throw a
    // LoginException
    DefaultSubject subject = new DefaultSubject();
    // grant principals to the user based on .....
    subject.addPrincipal(new SimplePrincipal("something"));
    return subject;
  }

}
View Full Code Here

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

    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;
    }
View Full Code Here

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

      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.hive.authentication.DefaultSubject.addPrincipal()

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

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

    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.hive.authentication.DefaultSubject.addPrincipal()

  {
    // 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.hive.authentication.DefaultSubject.addPrincipal()

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