Package net.shibboleth.idp.authn.principal

# Class PrincipalSupport

java.lang.Object
net.shibboleth.idp.authn.principal.PrincipalSupport

public final class PrincipalSupport extends Object
Helper class for accessing `Principal` information.

Since:
  5.1.0

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`PrincipalSupport()`
Private Constructor.

## Method Summary

Modifier and Type
Method
Description
`static Set<String>`
`getPrincipalNames(Subject subject, Class<? extends Principal> claz)`
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.
`static Set<String>`
`getPrincipalNames(AuthenticationResult result, Class<? extends Principal> claz)`
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.
`static Set<String>`
`getPrincipalNames(AuthenticationContext authenticationContext, String flowId, Class<? extends Principal> claz)`
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.
`static Set<String>`
`getPrincipalNames(MultiFactorAuthenticationContext mfaContext, String flowId, Class<? extends Principal> claz)`
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.

### Methods inherited from class java.lang.Object

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

## Constructor Details

### PrincipalSupport

private PrincipalSupport()
Private Constructor.

## Method Details

### getPrincipalNames

@Nonnull @Unmodifiable @NotLive public static Set<String> getPrincipalNames(@Nonnull Subject subject, @Nonnull Class<? extends Principal> claz)
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.

Parameters:
  `subject` - input subject
  `claz` - type of Principal
Returns:
  set of names from matching Principals

### getPrincipalNames

@Nonnull @Unmodifiable @NotLive public static Set<String> getPrincipalNames(@Nonnull AuthenticationResult result, @Nonnull Class<? extends Principal> claz)
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.

Parameters:
  `result` - authentication result
  `claz` - type of Principal
Returns:
  set of names from matching Principals

### getPrincipalNames

@Nonnull @Unmodifiable @NotLive public static Set<String> getPrincipalNames(@Nonnull AuthenticationContext authenticationContext, @Nonnull String flowId, @Nonnull Class<? extends Principal> claz)
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.

Parameters:
  `authenticationContext` - authentication context
  `flowId` - login flow Id
  `claz` - type of Principal
Returns:
  set of names from matching Principals

### getPrincipalNames

@Nonnull @Unmodifiable @NotLive public static Set<String> getPrincipalNames(@Nonnull MultiFactorAuthenticationContext mfaContext, @Nonnull String flowId, @Nonnull Class<? extends Principal> claz)
Gets all of the names inside the `Principal` collection of a given type from a `Subject`.

Parameters:
  `mfaContext` - multi-factor authentication context
  `flowId` - login flow Id
  `claz` - type of Principal
Returns:
  set of names from matching Principals