Record Class OidcClientCredentials
java.lang.Object
java.lang.Record
io.fluxzero.idp.client.OidcClientCredentials
- Record Components:
tokenEndpointAuthMethod- token endpoint authentication methodprivateJwk- RSA private JWK forprivate_key_jwt; never expose this to browser codetokenEndpointAudience- optional audience for the client assertion, defaults to token endpoint
- All Implemented Interfaces:
OidcClientAuthentication
public record OidcClientCredentials(OidcTokenEndpointAuthMethod tokenEndpointAuthMethod, String privateJwk, String tokenEndpointAudience)
extends Record
implements OidcClientAuthentication
Credentials used by a confidential application when exchanging an authorization code.
The default is a public PKCE client with no token endpoint authentication. Production BFF
applications should normally use privateKeyJwt(String) or
privateKeyJwt(String, String) so the backend proves possession of the registered client
key without sending a reusable client secret.
-
Constructor Summary
ConstructorsConstructorDescriptionOidcClientCredentials(OidcTokenEndpointAuthMethod tokenEndpointAuthMethod, String privateJwk, String tokenEndpointAudience) Creates an instance of aOidcClientCredentialsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the configured client authentication fields to a token request form.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static OidcClientCredentialsnone()Returns the value of theprivateJwkrecord component.static OidcClientCredentialsprivateKeyJwt(String privateJwk) static OidcClientCredentialsprivateKeyJwt(String privateJwk, String tokenEndpointAudience) Returns the value of thetokenEndpointAudiencerecord component.Returns the value of thetokenEndpointAuthMethodrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
OidcClientCredentials
public OidcClientCredentials(OidcTokenEndpointAuthMethod tokenEndpointAuthMethod, String privateJwk, String tokenEndpointAudience) Creates an instance of aOidcClientCredentialsrecord class.- Parameters:
tokenEndpointAuthMethod- the value for thetokenEndpointAuthMethodrecord componentprivateJwk- the value for theprivateJwkrecord componenttokenEndpointAudience- the value for thetokenEndpointAudiencerecord component
-
-
Method Details
-
none
-
privateKeyJwt
-
privateKeyJwt
-
addToTokenRequest
Adds the configured client authentication fields to a token request form.- Specified by:
addToTokenRequestin interfaceOidcClientAuthentication- Parameters:
form- mutable token request formclientId- OIDC client idtokenEndpoint- discovered token endpoint URL
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
tokenEndpointAuthMethod
Returns the value of thetokenEndpointAuthMethodrecord component.- Returns:
- the value of the
tokenEndpointAuthMethodrecord component
-
privateJwk
Returns the value of theprivateJwkrecord component.- Returns:
- the value of the
privateJwkrecord component
-
tokenEndpointAudience
Returns the value of thetokenEndpointAudiencerecord component.- Returns:
- the value of the
tokenEndpointAudiencerecord component
-