Class PrincipalAuthorizeCallback

java.lang.Object
org.wildfly.security.auth.callback.PrincipalAuthorizeCallback
All Implemented Interfaces:
Callback, ExtendedCallback

public class PrincipalAuthorizeCallback extends Object implements ExtendedCallback

An authorization callback similar to javase AuthorizeCallback but using a generic principal.

Author:
rmartinc
  • Constructor Details

    • PrincipalAuthorizeCallback

      public PrincipalAuthorizeCallback(String name)
      Creates a new instance to authorize the associated name. It will be transformed in a NamePrincipal.
      Parameters:
      name - the name to authorize
    • PrincipalAuthorizeCallback

      public PrincipalAuthorizeCallback(Principal principal)
      Creates a new instance to authorize the associated principal.
      Parameters:
      principal - the principal to authorize
  • Method Details

    • isAuthorized

      public boolean isAuthorized()
      Indicates if the principal was successfully authorized.
      Returns:
      true if the principal was successfully authorized. Otherwise, false
    • setAuthorized

      public void setAuthorized(boolean authorized)
      Sets whether the authorization is allowed for the principal.
      Parameters:
      authorized - authorization result
    • getPrincipal

      public Principal getPrincipal()
      Returns the Principal.
      Returns:
      the principal (not null)