Class GroupPrincipalCallback

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

public class GroupPrincipalCallback extends Object implements Callback
Callback that enables an authentication module to inform the runtime of the groups a user is in. The callback handler populates the given Subject with the group principals, or returns the group names that were provided.
  • Constructor Details

    • GroupPrincipalCallback

      public GroupPrincipalCallback(Subject subject, String[] groups)
      Constructs a callback with a Subject and an array of group names. The callback handler will create principals for the group names and add them to the subject.
      Parameters:
      subject - the subject to which the group principals will be added
      groups - the group names associated with the caller
  • Method Details

    • getSubject

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

      public String[] getGroups()
      Returns the group names associated with this callback.
      Returns:
      the group names