GroupPrincipalCallback (JASPIC 3.0 API Documentation - Apache Tomcat 10.1.57)
Description: declaration: package: jakarta.security.auth.message.callback, class: GroupPrincipalCallback

# 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 Summary

  Constructors
  Constructor
  Description
  `GroupPrincipalCallback(Subject subject, String[] groups)`
  Constructs a callback with a Subject and an array of group names.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `getGroups()`
  Returns the group names associated with this callback.
  `Subject`
  `getSubject()`
  Returns the Subject associated with this callback.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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