public static interface Token.Consumer<T extends Token>
Token consumers are responsible to provide all the necessary support to consume information from a specific Token
.
Modifier and Type | Method and Description |
---|---|
<I extends IdentityType> |
extractIdentity(T token,
Class<I> identityType,
StereotypeProperty.Property stereotypeProperty,
Object identifier)
Extracts a certain
IdentityType considering the information from the given Token . |
Class<T> |
getTokenType()
Returns the
Token type supported by this consumer. |
boolean |
validate(T token)
Validates a token.
|
<I extends IdentityType> I extractIdentity(T token, Class<I> identityType, StereotypeProperty.Property stereotypeProperty, Object identifier)
Extracts a certain IdentityType
considering the information from the given Token
.
Usually, a token contains a set of claims which can be mapped to the identity types supported by PicketLink IdentityStereotype.Stereotype
.
Each stereotype has a set of common properties that can be used to identify them. In this case, the StereotypeProperty.Property
should be
used to tell which property of the given identity type should be populated with the identifier
value if there is any claim in the token representing it.
token
- The token.identityType
- The type of the identity type that should be created based on the claims of a token.stereotypeProperty
- The stereotype property used to identify and populate the identity type instance from the token claims.identifier
- The value of the identifier used to match the existence of a identity type based on the token claims set.boolean validate(T token)
Validates a token.
token
- Copyright © 2018 JBoss by Red Hat. All rights reserved.