Messages - 2.1.2.1 How to signal that the field is optional?

Issue #377 invalid
Nat Sakimura created an issue

In the example, there is

{{{ "nickname": {"optional": true}, }}}

syntax, but it is not defined anywhere.

Also, currently, null is used to signal that the field is required, but what happens if the clients wants to send some information for the claim and still require the claim in the response?

Comments (2)

  1. John Bradley

    nickname is defined in Sec 2.3.2

    Sec 2.1.1.1.1 States optional: This is an optional Claim paramater, if present, its value MUST be true, which indicates that it is a optional Claim. If it is not present, it is a required Claim.

    Claims are always required unless optional is true.

    There are no additional parameters for the default set of user info claims.

    If it were another claim then it would be

    "http://schema.openid.org/age_bool": {"age" = 13 , "test": "equal_or over", "optional"= false }

    And the response would be: "http://schema.openid.org/age_over_value": {"age" = 13 , "test": "equal_or over", "valid"= true }

    We should probably define a clim like this to get people started.

  2. Michael Jones

    As the spec is written, a claim is required unless "optional":true is present. So the syntax for applying another constraint to a request is to use a JSON struture containing the additional constraint but without "optional":true being present in the structure.

  3. Log in to comment