Class JWTClientSecretCredentialsProvider
java.lang.Object
org.keycloak.protocol.oidc.client.authentication.JWTClientSecretCredentialsProvider
- All Implemented Interfaces:
ClientCredentialsProvider
Client authentication based on JWT signed by client secret instead of private key .
See specs for more details.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JsonWebTokencreateRequestToken(String clientId, String realmInfoUrl) createSignedRequestToken(String clientId, String realmInfoUrl) createSignedRequestToken(String clientId, String realmInfoUrl, String algorithm) getId()Return the ID of the provider.voidinit(AdapterConfig deployment, Object config) Called by adapter during deployment of your application.voidsetClientCredentials(AdapterConfig deployment, Map<String, String> requestHeaders, Map<String, String> formParams) Called every time adapter needs to perform backchannel requestvoidsetClientSecret(String clientSecretString) voidsetClientSecret(String clientSecretString, String algorithm)
-
Field Details
-
PROVIDER_ID
- See Also:
-
-
Constructor Details
-
JWTClientSecretCredentialsProvider
public JWTClientSecretCredentialsProvider()
-
-
Method Details
-
getId
Description copied from interface:ClientCredentialsProviderReturn the ID of the provider. Use this ID in the keycloak.json configuration as the subelement of the "credentials" element For example if your provider has ID "kerberos-keytab" , use the configuration like this in keycloak.json "credentials": { "kerberos-keytab": { "keytab": "/tmp/foo" } }- Specified by:
getIdin interfaceClientCredentialsProvider- Returns:
-
init
Description copied from interface:ClientCredentialsProviderCalled by adapter during deployment of your application. You can for example read configuration and init your authenticator here- Specified by:
initin interfaceClientCredentialsProvider- Parameters:
deployment- the adapter configurationconfig- the configuration of your provider read from keycloak.json . For the kerberos-keytab example above, it will return map with the single key "keytab" with value "/tmp/foo"
-
setClientCredentials
public void setClientCredentials(AdapterConfig deployment, Map<String, String> requestHeaders, Map<String, String> formParams) Description copied from interface:ClientCredentialsProviderCalled every time adapter needs to perform backchannel request- Specified by:
setClientCredentialsin interfaceClientCredentialsProvider- Parameters:
deployment- Fully resolved deploymentrequestHeaders- You should put any HTTP request headers you want to use for authentication of client. These headers will be attached to the HTTP request sent to Keycloak serverformParams- You should put any request parameters you want to use for authentication of client. These parameters will be attached to the HTTP request sent to Keycloak server
-
setClientSecret
-
setClientSecret
-
createSignedRequestToken
-
createSignedRequestToken
-
createRequestToken
-