Class ServiceConfigurationRequest

  • All Implemented Interfaces:
    Serializable

    public class ServiceConfigurationRequest
    extends Object
    implements Serializable
    The request parameters of Authlete's /service/configuration API.

    pretty

    If pretty=true is given to the Authlete API, the returned JSON is formatted in a human-friendly way.

    patch

    The /service/configuration API returns JSON that conforms to OpenID Connect Discovery 1.0. Implementations of the discovery endpoint may modify the JSON before returning it as a discovery response.

    Although implementations of the discovery endpoint have perfect control over the JSON, in some cases implementations may want to make the Authlete API execute adjustments on Authlete side so that the implementations can avoid modifying the received JSON after the API call.

    The patch request parameter has been added for the purpose.

    Implementations of the discovery endpoint may specify a JSON Patch by the patch request parameter. If the request parameter is given, the Authlete API applies the patch to the JSON before returning it to the API caller.

    The value of the patch request parameter must conform to the format that is defined in RFC 6902 JavaScript Object Notation (JSON) Patch.

    Example 1: Replace

     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       | jq .subject_types_supported
     [
       "public",
       "pairwise"
     ]
     
     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
          -d patch='[{"op":"replace","path":"/subject_types_supported","value":["public"]}]'
          | jq .subject_types_supported
     [
       "public"
     ]
     

    Example 2: Add

     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       | jq .custom_metadata
     null
     
     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       -d patch='[{"op":"add","path":"/custom_metadata","value":"custom_value"}]'
       | jq .custom_metadata
     "custom_value"
     

    Example 3: Add Array Elements

     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       | jq .acr_values_supported
     [
       "acr1"
     ]
     
     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       -d patch='[{"op":"add","path":"/acr_values_supported/0","value":"acr0"}]'
       | jq .acr_values_supported
     [
       "acr0",
       "acr1"
     ]
     
     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       -d patch='[{"op":"add","path":"/acr_values_supported/0","value":"acr0"},
                  {"op":"add","path":"/acr_values_supported/-","value":"acr2"}]'
       | jq .acr_values_supported
     [
       "acr0",
       "acr1",
       "acr2"
     ]
     

    Example 4: Add Object Elements

     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       | jq .mtls_endpoint_aliases
     {
       "authorization_endpoint": "https://as.example.com/mtls/authorize"
     }
     
     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       -d patch='[{"op":"add","path":"/mtls_endpoint_aliases/token_endpoint","value":"https://as.example.com/mtls/token"}]'
       | jq .mtls_endpoint_aliases
     {
       "authorization_endpoint": "https://as.example.com/mtls/authorize",
       "token_endpoint": "https://as.example.com/mtls/token"
     }
     

    Example 5: Remove

     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       | jq .acr_values_supported
     [
       "acr1"
     ]
     
     $ curl -s -u $SERVICE_API_KEY:$SERVICE_API_SECRET $BASE_URL/api/service/configuration
       -d patch='[{"op":"remove","path":"/acr_values_supported"}]'
       | jq .acr_values_supported
     null
     

    Note

    The patch request parameter is supported since Authlete 2.2.36.

    Since:
    3.43
    See Also:
    OpenID Connect Discovery 1.0, RFC 6902 JavaScript Object Notation (JSON) Patch, Serialized Form