Class CallerPrincipalCallback

java.lang.Object
jakarta.security.auth.message.callback.CallerPrincipalCallback
All Implemented Interfaces:
Callback

public class CallerPrincipalCallback extends Object implements Callback
Callback that enables an authentication module to inform the runtime of the caller principal or name of the caller principal. The callback handler populates the given Subject with the authenticated principal, or returns the principal/name that was provided.
  • Constructor Details

    • CallerPrincipalCallback

      public CallerPrincipalCallback(Subject subject, Principal principal)
      Constructs a callback with a Subject and a Principal. The callback handler will add the principal to the subject.
      Parameters:
      subject - the subject to which the principal will be added
      principal - the principal representing the caller
    • CallerPrincipalCallback

      public CallerPrincipalCallback(Subject subject, String name)
      Constructs a callback with a Subject and a caller name. The callback handler will create a principal from the name and add it to the subject.
      Parameters:
      subject - the subject to which the principal will be added
      name - the name of the caller
  • Method Details

    • getSubject

      public Subject getSubject()
      Returns the Subject associated with this callback.
      Returns:
      the Subject
    • getPrincipal

      public Principal getPrincipal()
      Returns the Principal associated with this callback, or null if a name was provided instead.
      Returns:
      the Principal, or null
    • getName

      public String getName()
      Returns the name associated with this callback, or null if a Principal was provided instead.
      Returns:
      the name, or null