Skip to content

Commit cfd343e

Browse files
authored
Update OIDC docs to include language on the use of nonce (#1177)
1 parent 60ec732 commit cfd343e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/reference/other/openid.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,17 @@ Configure your OIDC library with the following parameters:
3535
| `scope` | `openid` |
3636
| `client_id` | Any string which uniquely represents your client application |
3737
| `redirect_uri` | The URI your user should be redirected to once they have completed (or canceled) the flow |
38+
| `nonce` | *(Optional)* Random nonce value that will be used to bind the generated presentation to the issued token. If not specified, one will be randomly generated. Use this to prevent presentation replays. |
3839
| **Trinsic-Specific Parameters** |
3940
| `trinsic:ecosystem` | ID of ecosystem user wallet resides in |
4041
| `trinsic:schema` | *(Optional)* Comma-separated listed of Schema URLs. Only credentials which match one of these schemas will be returned. |
4142
| `trinsic:issuer` | *(Optional)* Comma-separated list of Issuer DIDs. Only credentials issued by one of these issuers will be returned. |
4243
| `trinsic:egf` | *(Optional)* Comma-separated list of [Entity Governance Framework](/learn/concepts/trust-registries) IDs. Only credentials bound to one of these EGF IDs will be returned. |
4344

45+
### Presentation Replays and ID Tokens
46+
47+
In order to prevent verifiable presentation replays, always specify the `nonce` parameter in the initial call to the authorization endpoint. This will ensure that the generated presentation and the ID token match the current request.
48+
4449
### Response Data
4550

4651
Once the user has returned to your redirect URL, exchange the authorization code (added to your redirect URI as a query parameter named `code`) for an identity token using your OIDC library.
@@ -82,22 +87,24 @@ You will receive a JSON object of the following form:
8287
```
8388

8489
!!! info "Credential Format"
85-
Note that the above data has been modified for brevity.
90+
Note that the above data has been modified for brevity.
8691

8792
The `@context` and `type` arrays will contain additional entries which are specific to the credential.
8893

8994

9095
### Verify the Received Proof
9196

92-
`vp_token` is a Verifiable Proof; before making use of its data, you must verify it.
97+
`vp_token` is a Verifiable Proof; before making use of its data, you must verify it.
9398

9499
This proof can be verified with any library that supports VC verifications for BBS+ signatures. It can also be verified using Trinsic's SDK; this is as simple as [passing the proof to the VerifyProof call](../../services/credential-service/#verify-proof).
95100

101+
If you specified a `nonce` in the authorization request, always verify that the `nonce` claim in the JWT ID token matches the similarly named value in the `_vp_token` document. You may find the nonce in the `_vp_token.proof.nonce` path in the JSON structure. Note that the value in this proof may be specified in base64 format, so you may need to reformat your nonce before comparing. If you specified the nonce as base64 in the request, the two values should match with direct string comparison.
102+
96103

97104
!!! warning "Always Verify"
98105
It may be tempting to simply take the data in `vp_token` and act upon it without first verifying the proof.
99106

100-
**Always verify the proof** before making use of its data.
107+
**Always verify the proof** before making use of its data.
101108

102109
Without verification, the received proof is of no more value than an unsubstantiated claim made by your user.
103110

@@ -137,4 +144,4 @@ The [OpenID Connect website](https://openid.net/developers/certified/) lists a n
137144
- :material-language-java: [Java](https://docs.spring.io/spring-security/site/docs/5.2.12.RELEASE/reference/html/oauth2.html)
138145
- :material-language-ruby: [Ruby](https://github.com/nov/openid_connect)
139146

140-
</div>
147+
</div>

0 commit comments

Comments
 (0)