Class IdTokenValidationFilterHeaplet
- java.lang.Object
-
- org.forgerock.openig.heap.GenericHeaplet
-
- org.forgerock.openig.filter.jwt.JwtValidationFilter.Heaplet
-
- org.forgerock.openig.filter.oauth2.client.IdTokenValidationFilterHeaplet
-
- All Implemented Interfaces:
Heaplet
public class IdTokenValidationFilterHeaplet extends JwtValidationFilter.Heaplet
AnIdTokenValidationFilterHeaplet
creates a filter that can be used to validate the givenidToken
according to the provided configuration by leveraging theJwtValidationFilter
. If theJwt
is verified, the chain of execution continues, with anJwtValidationContext
provided. If theJwt
is not valid, this filter directly exits the chain by returning either a 403 Forbidden response (by default) or the response built by the given failure handler. In case of errors, anJwtValidationErrorContext
is provided.Configuration options:
{ "idToken" : expression [REQUIRED] "audience" : expression [REQUIRED - to validate the 'aud' attribute.] "failureHandler" : handler [OPTIONAL - the failure handler - default is FORBIDDEN.] "issuer" : expression [OPTIONAL - to validate the 'iss' attribute.] "skewAllowance" : expression<duration> [OPTIONAL - the skew allowance - defaults to zero.] "verificationSecretId" : Secret ID [OPTIONAL - to verify the signature of the IdToken.] "secretsProvider" : SecretsProvider [OPTIONAL - secrets provider used to obtain secrets. REQUIRED if 'verificationSecretId' is used.] "customizer" : JwtValidatorCustomizer [OPTIONAL - to add special claim checks. This will not override pre-defined constraints on "aud", "iss", "exp" and "iat"] }
SignedJwt
:{ "type": "IdTokenValidationFilter", "config": { "idToken": "${attributes.openid.id_token}" "audience": "ForgeShop" "issuer": "http://openam.example.com:8090/openam/oauth2", "verificationSecretId": "signature.verification.secret.id", "secretsProvider": "SecretsProvider", "customizer": { "type": "ScriptableJwtValidatorCustomizer", "config": { "type": "application/x-groovy", "source": [ "builder.claim('myClaim', JsonValue::asString, isEqualTo('foobar'))" ] } } } }
- See Also:
- OpenID Connect
-
-
Constructor Summary
Constructors Constructor Description IdTokenValidationFilterHeaplet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Expression<String>
jwtExpression()
Returns the expression to be used to obtain the JWT token value.protected Optional<JwtValidatorCustomizer>
jwtValidatorCustomizer()
Returns an instance of aJwtValidatorCustomizer
if one has been defined.-
Methods inherited from class org.forgerock.openig.filter.jwt.JwtValidationFilter.Heaplet
create
-
Methods inherited from class org.forgerock.openig.heap.GenericHeaplet
create, destroy, endpointRegistry, evaluatedWithHeapProperties, expression, getConfig, getHeap, getSecretService, getType, meterRegistryHolder, start
-
-
-
-
Method Detail
-
jwtExpression
protected Expression<String> jwtExpression()
Description copied from class:JwtValidationFilter.Heaplet
Returns the expression to be used to obtain the JWT token value.- Overrides:
jwtExpression
in classJwtValidationFilter.Heaplet
- Returns:
- the expression to be used to obtain the JWT token value.
-
jwtValidatorCustomizer
protected Optional<JwtValidatorCustomizer> jwtValidatorCustomizer() throws HeapException
Description copied from class:JwtValidationFilter.Heaplet
Returns an instance of aJwtValidatorCustomizer
if one has been defined.- Overrides:
jwtValidatorCustomizer
in classJwtValidationFilter.Heaplet
- Returns:
- an instance of a
JwtValidatorCustomizer
if one has been defined. - Throws:
HeapException
- if there were any issues defining the instance.
-
-