Class DistributedClaims


  • public class DistributedClaims
    extends Object
    Distributed OpenID claims set.

    Example distributed claims with an access token (included in a UserInfo response):

     {
       "_claim_names"   : { "credit_score" : "src1" },
       "_claim_sources" : { "src1" : { "endpoint"     : "https://creditagency.example.com/claims_here",
                                       "access_token" : "ksj3n283dke" } }
     }
     

    Example distributed claims without a specified access token (included in a UserInfo response):

     {
       "_claim_names" : { "payment_info"     : "src2",
                          "shipping_address" : "src2" },
       "_claim_sources" : { "src2" : { "endpoint" : "https://bank.example.com/claim_source" } }
     }
     

    Related specifications:

    • OpenID Connect Core 1.0, sections 5.1 and 5.6.2.
    • Constructor Detail

      • DistributedClaims

        public DistributedClaims​(Set<String> names,
                                 URI sourceEndpoint,
                                 AccessToken accessToken)
        Creates a new aggregated OpenID claims instance, the claims source identifier is set to a GUUID string.
        Parameters:
        names - The claim names. Must not be null or empty.
        sourceEndpoint - The claims source endpoint. Must not be null.
        accessToken - Access token for retrieving the claims at the source endpoint, null if not specified.
      • DistributedClaims

        public DistributedClaims​(String sourceID,
                                 Set<String> names,
                                 URI sourceEndpoint,
                                 AccessToken accessToken)
        Creates a new aggregated OpenID claims instance.
        Parameters:
        sourceID - Identifier for the claims source. Must not be null or empty string.
        names - The claim names. Must not be null or empty.
        sourceEndpoint - The claims source endpoint. Must not be null.
        accessToken - Access token for retrieving the claims at the source endpoint, null if not specified.
    • Method Detail

      • getSourceEndpoint

        public URI getSourceEndpoint()
        Returns the claims source endpoint.
        Returns:
        The claims source endpoint.
      • getAccessToken

        public AccessToken getAccessToken()
        Returns the access token for retrieving the claims at the source endpoint.
        Returns:
        The access token for retrieving the claims at the source endpoint, null if not specified.
      • getSourceID

        public String getSourceID()
        Returns the identifier for this claims source.
        Returns:
        The source identifier.
      • getNames

        public Set<String> getNames()
        Returns the claim names.
        Returns:
        The claim names.