Package net.shibboleth.idp.authn.impl

# Class SimpleSubjectCanonicalization

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor
net.shibboleth.idp.authn.AbstractSubjectCanonicalizer
net.shibboleth.idp.authn.impl.SimpleSubjectCanonicalization

All Implemented Interfaces:
  `Function<SubjectCanonicalizationContext,String>`, `Predicate<ProfileRequestContext>`, `SubjectCanonicalizer`, `FlowDescriptor`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

public class SimpleSubjectCanonicalization extends AbstractSubjectCanonicalizer
A `SubjectCanonicalizer` that transforms the input `Subject` into a principal name by searching for one and only one `UsernamePrincipal` custom principal.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`SimpleSubjectCanonicalization()`

## Method Summary

Modifier and Type
Method
Description
`String`
`doApply(SubjectCanonicalizationContext c14nContext)`
Performs c14n if possible.
`private UsernamePrincipal`
`getUsernamePrincipal(SubjectCanonicalizationContext c14nContext)`
Helper method that returns the first and only `UsernamePrincipal`, returning null otherwise.

### Methods inherited from class net.shibboleth.idp.authn.AbstractSubjectCanonicalizer

`apply, applyTransforms, doInitialize, getLogPrefix, setLowercase, setTransforms, setTrim, setUppercase`

### Methods inherited from class net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor

`equals, getFlowId, hashCode, setActivationCondition, setFlowId, test, toString`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface java.util.function.Function

`andThen, compose`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiableComponent

`setId`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface java.util.function.Predicate

`and, negate, or`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

## Constructor Details

### SimpleSubjectCanonicalization

public SimpleSubjectCanonicalization()

## Method Details

### doApply

@Nullable public String doApply(@Nonnull SubjectCanonicalizationContext c14nContext)
Performs c14n if possible.

Specified by:
  `doApply` in class `AbstractSubjectCanonicalizer`
Parameters:
  `c14nContext` - the current subject canonicalization context
Returns:
  event indicating result of function

### getUsernamePrincipal

@Nullable private UsernamePrincipal getUsernamePrincipal(@Nonnull SubjectCanonicalizationContext c14nContext)
Helper method that returns the first and only `UsernamePrincipal`, returning null otherwise.

Parameters:
  `c14nContext` - input context
Returns:
  the only matching principal or null