Class JWTClientSecretCredentialsProvider

    • Field Detail

      • clientSecret

        private SecretKey clientSecret
      • clientSecretJwtAlg

        private String clientSecretJwtAlg
      • tokenTimeout

        private int tokenTimeout
    • Constructor Detail

      • JWTClientSecretCredentialsProvider

        public JWTClientSecretCredentialsProvider()
    • Method Detail

      • getId

        public String getId()
        Description copied from interface: ClientCredentialsProvider
        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" } }
        Specified by:
        getId in interface ClientCredentialsProvider
        Returns:
        the ID of the provider
      • setTokenTimeout

        public void setTokenTimeout​(int tokenTimeout)
      • getTokenTimeout

        protected int getTokenTimeout()
      • init

        public void init​(OidcClientConfiguration oidcClientConfiguration,
                         Object credentialsConfig)
        Description copied from interface: ClientCredentialsProvider
        Called during deployment of your application.
        Specified by:
        init in interface ClientCredentialsProvider
        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"
      • isValidClientSecretJwtAlg

        private boolean isValidClientSecretJwtAlg​(String clientSecretJwtAlg)
      • setClientCredentials

        public void setClientCredentials​(OidcClientConfiguration oidcClientConfiguration,
                                         Map<String,​String> requestHeaders,
                                         Map<String,​String> formParams)
        Description copied from interface: ClientCredentialsProvider
        Called every time a backchannel request is performed.
        Specified by:
        setClientCredentials in interface ClientCredentialsProvider
        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
      • setClientSecret

        public void setClientSecret​(String clientSecretString)
      • setClientSecret

        public void setClientSecret​(String clientSecretString,
                                    String algorithm)
      • createSignedRequestToken

        public String createSignedRequestToken​(String clientId,
                                               String tokenUrl)
      • createSignedRequestToken

        public String createSignedRequestToken​(String clientId,
                                               String tokenUrl,
                                               String algorithm)
      • createRequestToken

        private org.jose4j.jwt.JwtClaims createRequestToken​(String clientId,
                                                            String tokenUrl)