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
Fields Modifier and Type Field Description protected SecretsProvider
secretsProvider
SecretsProvider
capable of providing the secret.
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PrivateKeyJwtClientAuthenticationFilter
build()
Builds the PrivateKey Jwt ClientAuthentication Filter.protected void
buildSecretReferences()
Deprecated, for removal: This API element is subject to removal in a future version.for removal withwithSigningPurpose(Purpose)
.protected T
self()
Returns this object, as its actual type.String
toString()
T
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.T
withClientId(String clientId)
Sets the client id that will be used in the private key jwt.T
withClock(Clock clock)
Sets the clock instance.T
withPrivateKeyJwtExpiryTime(Duration privateKeyJwtExpiryTime)
Sets duration after the jwt will expire.T
withSecretsProvider(SecretsProvider secretsProvider)
Deprecated, for removal: This API element is subject to removal in a future version.Please useSecretReference
API instead.T
withSigningAlgorithm(JwsAlgorithm signingAlgorithm)
Sets algorithm used to sign the private key jwt.T
withSigningPurpose(Purpose<SigningKey> signingPurpose)
Deprecated, for removal: This API element is subject to removal in a future version.Please usewithSigningSecretReference(SecretReference)
instead.T
withSigningSecretReference(SecretReference<SigningKey> secretReference)
SetsSecretReference
to use as the signing key.T
withTokenEndpoint(URI tokenEndpoint)
Sets the token end point used to specify as the aud in the private key jwt.
-
-
-
Field Detail
-
secretsProvider
protected SecretsProvider secretsProvider
SecretsProvider
capable of providing the secret.
-
-
Method Detail
-
self
protected T self()
Returns this object, as its actual type.- Returns:
- this object.
-
withClientId
public T withClientId(String clientId)
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
public T withTokenEndpoint(URI tokenEndpoint)
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
public T withSigningSecretReference(SecretReference<SigningKey> secretReference)
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
public T withSigningAlgorithm(JwsAlgorithm signingAlgorithm)
Sets algorithm used to sign the private key jwt.- Parameters:
signingAlgorithm
- The algorithm used to sign the private key jwt.- Returns:
- The builder.
-
withPrivateKeyJwtExpiryTime
public T withPrivateKeyJwtExpiryTime(Duration privateKeyJwtExpiryTime)
Sets duration after the jwt will expire.- Parameters:
privateKeyJwtExpiryTime
- The duration after the jwt will expire.- Returns:
- The builder.
-
withClock
public T withClock(Clock clock)
Sets the clock instance.- Parameters:
clock
- The clock instance.- Returns:
- The builder.
-
withClaims
public T 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.- Parameters:
claims
- Any additional JWT claims.- Returns:
- The builder.
-
build
public PrivateKeyJwtClientAuthenticationFilter build()
Builds the PrivateKey Jwt ClientAuthentication Filter.- Returns:
- The PrivateKey Jwt ClientAuthentication Filter.
-
buildSecretReferences
@Deprecated(since="26.2.0", forRemoval=true) protected void 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.
-
-