Package org.forgerock.http.oauth2
Class PrivateKeyJwtClientAuthenticationFilter.Builder<T extends PrivateKeyJwtClientAuthenticationFilter.Builder<T>>
java.lang.Object
org.forgerock.http.oauth2.PrivateKeyJwtClientAuthenticationFilter.Builder<T>
- Type Parameters:
T
- the type of Filter builder to build.
- Direct Known Subclasses:
EncryptedPrivateKeyJwtClientAuthenticationFilter.Builder
- Enclosing class:
- PrivateKeyJwtClientAuthenticationFilter
public static class PrivateKeyJwtClientAuthenticationFilter.Builder<T extends PrivateKeyJwtClientAuthenticationFilter.Builder<T>>
extends Object
Builder class for creating the PrivateKey Jwt ClientAuthentication Filter.
-
Field Summary
Modifier and TypeFieldDescriptionprotected SecretsProvider
SecretsProvider
capable of providing the secret. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the PrivateKey Jwt ClientAuthentication Filter.protected void
Deprecated, for removal: This API element is subject to removal in a future version.protected T
self()
Returns this object, as its actual type.toString()
withClaims
(Map<String, Object> claims) Sets any additional JWT claims, which may be overridden by claims created as part of creation of the private-key JWT.withClientId
(String clientId) Sets the client id that will be used in the private key jwt.Sets the clock instance.withPrivateKeyJwtExpiryTime
(Duration privateKeyJwtExpiryTime) Sets duration after the jwt will expire.withSecretsProvider
(SecretsProvider secretsProvider) Deprecated, for removal: This API element is subject to removal in a future version.Please useSecretReference
API instead.withSigningAlgorithm
(JwsAlgorithm signingAlgorithm) Sets algorithm used to sign the private key jwt.withSigningPurpose
(Purpose<SigningKey> signingPurpose) Deprecated, for removal: This API element is subject to removal in a future version.Please usewithSigningSecretReference(SecretReference)
instead.withSigningSecretReference
(SecretReference<SigningKey> secretReference) SetsSecretReference
to use as the signing key.withTokenEndpoint
(URI tokenEndpoint) Sets the token end point used to specify as the aud in the private key jwt.
-
Field Details
-
secretsProvider
SecretsProvider
capable of providing the secret.
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
self
Returns this object, as its actual type.- Returns:
- this object.
-
withClientId
Sets the client id that will be used in the private key jwt.- Parameters:
clientId
- The client id that will be used in the private key jwt.- Returns:
- The builder.
-
withTokenEndpoint
Sets the token end point used to specify as the aud in the private key jwt.- Parameters:
tokenEndpoint
- The token end point used to specify as the aud in the private key jwt.- Returns:
- The builder.
-
withSecretsProvider
@Deprecated(since="26.2.0", forRemoval=true) public T withSecretsProvider(SecretsProvider secretsProvider) Deprecated, for removal: This API element is subject to removal in a future version.Please useSecretReference
API instead. Will be removed in winter 2021 season.Sets the secrets provider to use to resolve keys where aPurpose
is used.- Parameters:
secretsProvider
- The secrets provider.- Returns:
- The builder.
-
withSigningPurpose
@Deprecated(since="26.2.0", forRemoval=true) public T withSigningPurpose(Purpose<SigningKey> signingPurpose) Deprecated, for removal: This API element is subject to removal in a future version.Please usewithSigningSecretReference(SecretReference)
instead. Will be removed in winter 2021 season.Sets purpose to look up the signing key. Note that you should provide either theSecretReference
(preferred) or both the signingPurpose
andSecretsProvider
, so that the signing key can be determined.- Parameters:
signingPurpose
- The signing purpose.- Returns:
- The builder.
-
withSigningSecretReference
SetsSecretReference
to use as the signing key. Note that this is the preferred way of providing the signing secret reference, though you may alternatively provide both the signingPurpose
andSecretsProvider
.- Parameters:
secretReference
- The secret reference used to sign the JWT.- Returns:
- The builder.
-
withSigningAlgorithm
Sets algorithm used to sign the private key jwt.- Parameters:
signingAlgorithm
- The algorithm used to sign the private key jwt.- Returns:
- The builder.
-
withPrivateKeyJwtExpiryTime
Sets duration after the jwt will expire.- Parameters:
privateKeyJwtExpiryTime
- The duration after the jwt will expire.- Returns:
- The builder.
-
withClock
Sets the clock instance.- Parameters:
clock
- The clock instance.- Returns:
- The builder.
-
withClaims
Sets any additional JWT claims, which may be overridden by claims created as part of creation of the private-key JWT.- Parameters:
claims
- Any additional JWT claims.- Returns:
- The builder.
-
toString
-
build
Builds the PrivateKey Jwt ClientAuthentication Filter.- Returns:
- The PrivateKey Jwt ClientAuthentication Filter.
-
buildSecretReferences
Deprecated, for removal: This API element is subject to removal in a future version.for removal withwithSigningPurpose(Purpose)
. Will be removed in winter 2021 season.Set the signing secret reference in the builder based on supplied configuration, whether by direct provision of theSecretReference
or via theSecretsProvider
andPurpose
. This method provides compatibility between these two ways of providing the signing secret reference.
-
withSigningPurpose(Purpose)
.