Class ClientRegistrations

    • Method Detail

      • fromIssuerLocation

        public static ClientRegistration.Builder fromIssuerLocation​(java.lang.String issuer)
        Creates a ClientRegistration.Builder using the provided Issuer by querying three different discovery endpoints serially, using the values in the first successful response to initialize. If an endpoint returns anything other than a 200 or a 4xx, the method will exit without attempting subsequent endpoints. The three endpoints are computed as follows, given that the issuer is composed of a host and a path:
        1. host/.well-known/openid-configuration/path, as defined in RFC 8414's Compatibility Notes.
        2. issuer/.well-known/openid-configuration, as defined in OpenID Provider Configuration.
        3. host/.well-known/oauth-authorization-server/path, as defined in Authorization Server Metadata Request.
        Note that the second endpoint is the equivalent of calling fromOidcIssuerLocation(String).

        Example usage:

         ClientRegistration registration = ClientRegistrations.fromIssuerLocation("https://example.com")
             .clientId("client-id")
             .clientSecret("client-secret")
             .build();
         
        Parameters:
        issuer -
        Returns:
        a ClientRegistration.Builder that was initialized by one of the described endpoints