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 SecretsProvidersecretsProviderSecretsProvidercapable 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 PrivateKeyJwtClientAuthenticationFilterbuild()Builds the PrivateKey Jwt ClientAuthentication Filter.protected voidbuildSecretReferences()Deprecated, for removal: This API element is subject to removal in a future version.for removal withwithSigningPurpose(Purpose).protected Tself()Returns this object, as its actual type.StringtoString()TwithClaims(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.TwithClientId(String clientId)Sets the client id that will be used in the private key jwt.TwithClock(Clock clock)Sets the clock instance.TwithPrivateKeyJwtExpiryTime(Duration privateKeyJwtExpiryTime)Sets duration after the jwt will expire.TwithSecretsProvider(SecretsProvider secretsProvider)Deprecated, for removal: This API element is subject to removal in a future version.Please useSecretReferenceAPI instead.TwithSigningAlgorithm(JwsAlgorithm signingAlgorithm)Sets algorithm used to sign the private key jwt.TwithSigningPurpose(Purpose<SigningKey> signingPurpose)Deprecated, for removal: This API element is subject to removal in a future version.Please usewithSigningSecretReference(SecretReference)instead.TwithSigningSecretReference(SecretReference<SigningKey> secretReference)SetsSecretReferenceto use as the signing key.TwithTokenEndpoint(URI tokenEndpoint)Sets the token end point used to specify as the aud in the private key jwt.
-
-
-
Field Detail
-
secretsProvider
protected SecretsProvider secretsProvider
SecretsProvidercapable 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 useSecretReferenceAPI instead. Will be removed in winter 2021 season.Sets the secrets provider to use to resolve keys where aPurposeis 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 signingPurposeandSecretsProvider, so that the signing key can be determined.- Parameters:
signingPurpose- The signing purpose.- Returns:
- The builder.
-
withSigningSecretReference
public T withSigningSecretReference(SecretReference<SigningKey> secretReference)
SetsSecretReferenceto 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 signingPurposeandSecretsProvider.- 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 theSecretReferenceor via theSecretsProviderandPurpose. This method provides compatibility between these two ways of providing the signing secret reference.
-
-