Class CallerPrincipalCallback
java.lang.Object
jakarta.security.auth.message.callback.CallerPrincipalCallback
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCallerPrincipalCallback(Subject subject, String name) Constructs a callback with a Subject and a caller name.CallerPrincipalCallback(Subject subject, Principal principal) Constructs a callback with a Subject and a Principal. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Returns the name associated with this callback, ornullif a Principal was provided instead.Returns the Principal associated with this callback, ornullif a name was provided instead.Returns the Subject associated with this callback.
-
Constructor Details
-
CallerPrincipalCallback
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 addedprincipal- the principal representing the caller
-
CallerPrincipalCallback
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 addedname- the name of the caller
-
-
Method Details
-
getSubject
-
getPrincipal
Returns the Principal associated with this callback, ornullif a name was provided instead.- Returns:
- the Principal, or
null
-
getName
Returns the name associated with this callback, ornullif a Principal was provided instead.- Returns:
- the name, or
null
-