Interface ClientCredentialsProvider

  • All Known Subinterfaces:
    ClientSecretCredentialsProvider
    All Known Implementing Classes:
    ClientIdAndSecretCredentialsProvider, JWTClientCredentialsProvider, JWTClientSecretCredentialsProvider

    public interface ClientCredentialsProvider
    SPI for authenticating clients/applications. This is used during all OIDC backchannel requests to the OpenID provider (codeToToken exchange, refresh token or backchannel logout). You can also use it in your application during direct access grants or service account request. You must specify a file META-INF/services/org.wildfly.security.http.oidc.ClientCredentialsProvider in the WAR that this class is contained in (or in the JAR that is attached to the WEB-INF/lib or as jboss module if you want to share the implementation among more WARs).
    Author:
    Marek Posolda, Farah Juma
    • Method Detail

      • getId

        String getId()
        Return the ID of the provider. Use this ID in the oidc.json configuration as the sub-element of the "credentials" element For example if your provider has ID "some-provider", use the configuration like this in oidc.json "credentials": { "some-provider": { "someAttribute": "someValue" } }
        Returns:
        the ID of the provider
      • init

        void init​(OidcClientConfiguration oidcClientConfiguration,
                  Object credentialsConfig)
        Called during deployment of your application.
        Parameters:
        oidcClientConfiguration - the OIDC client configuration
        credentialsConfig - the configuration of your credentials provider read from oidc.json. For the some-provider example above, it will return map with the single key "someAttribute" with value "someValue"
      • setClientCredentials

        void setClientCredentials​(OidcClientConfiguration oidcClientConfiguration,
                                  Map<String,​String> requestHeaders,
                                  Map<String,​String> formParams)
        Called every time a backchannel request is performed.
        Parameters:
        oidcClientConfiguration - the fully resolved OIDC client configuration
        requestHeaders - 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 the OpenID provider
        formParams - 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 the OpenID provider