Skip to content

Commit b8e3ce8

Browse files
pottisSuresh Potti
andauthored
Deprecate nonce parameter (#768)
* Removed 'nonce' field from IdentityProviderRequestOptions and added a note * Addressed review comments --------- Co-authored-by: Suresh Potti <[email protected]>
1 parent 2b9b7e7 commit b8e3ce8

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

spec/index.bs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,8 @@ could be implemented.
150150
<button onclick="login()">Login with idp.example</button>
151151

152152
<script>
153-
let nonce;
154153
async function login() {
155154
try {
156-
// Assume there is a method returning a random number. Store the value in a variable which can
157-
// later be used to check against the value in the token returned.
158-
nonce = random();
159155
// Prompt the user to select an account from the IDP to use for
160156
// federated login within the RP. If resolved successfully, the Promise
161157
// returns an IdentityCredential object from which the |token| can be
@@ -165,7 +161,6 @@ could be implemented.
165161
providers: [{
166162
configURL: "https://idp.example/manifest.json",
167163
clientId: "123",
168-
nonce: nonce,
169164
}]
170165
}
171166
});
@@ -237,7 +232,6 @@ identity federation.
237232
| " providers: [{ " | |
238233
| " configURL: 'config.json'," | |
239234
| " clientId: clientId, " | |
240-
| " nonce: nonce, " | |
241235
| " }] " | |
242236
| " } " | |
243237
| "}) " | |
@@ -687,7 +681,9 @@ const credential = await navigator.credentials.get({
687681
providers: [{ // sequence<IdentityCredentialRequestOptions>
688682
configURL: "https://idp.example/manifest.json", // IdentityProviderConfig.configURL
689683
clientId: "123", // IdentityProviderConfig.clientId
690-
nonce: "nonce" // IdentityProviderConfig.nonce
684+
params: {
685+
nonce: "nonce"
686+
}
691687
}]
692688
}
693689
});
@@ -741,7 +737,6 @@ dictionary IdentityProviderConfig {
741737
};
742738

743739
dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
744-
USVString nonce;
745740
DOMString loginHint;
746741
DOMString domainHint;
747742
sequence<USVString> fields;
@@ -754,10 +749,6 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
754749
:: The URL of the configuration file for the identity provider.
755750
: <b>{{IdentityProviderConfig/clientId}}</b>
756751
:: The {{id_assertion_endpoint_request/client_id}} provided to the [=RP=] out of band by the [=IDP=]
757-
: <b>{{IdentityProviderRequestOptions/nonce}}</b>
758-
:: A random number of the choice of the [=RP=]. It is generally used to associate a client
759-
session with a {{IdentityAssertionResponse/token}} and to mitigate replay attacks.
760-
Therefore, this value should have sufficient entropy such that it would be hard to guess.
761752
: <b>{{IdentityProviderRequestOptions/loginHint}}</b>
762753
:: A string representing the login hint corresponding to an account which the RP wants the user
763754
agent to show to the user. If provided, the user agent will not show accounts which do not
@@ -768,6 +759,8 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
768759
interested in, or "any" if the [=RP=] wants any account associated with at least one domain
769760
hint. If provided, the user agent will not show accounts which do not match the domain hint
770761
value.
762+
763+
Note: "nonce" is to be passed within {{IdentityProviderRequestOptions/params}}.
771764
</dl>
772765

773766
<!-- ============================================================ -->
@@ -1459,7 +1452,6 @@ To <dfn>fetch an identity assertion</dfn> given a {{USVString}}
14591452
1. <dfn for="fetch identity assertion">Create a list</dfn>: let |list| be a list with the
14601453
following entries:
14611454
1. ("client_id", |provider|'s {{IdentityProviderConfig/clientId}})
1462-
1. ("nonce", |provider|'s {{IdentityProviderRequestOptions/nonce}})
14631455
1. ("account_id", |accountId|)
14641456
1. ("is_auto_selected", |isAutoSelected|)
14651457
1. If |provider|'s {{IdentityProviderRequestOptions/params}} is not empty:
@@ -2379,8 +2371,6 @@ It will also contain the following parameters in the request body `application/x
23792371
<dl dfn-type="argument" dfn-for="id_assertion_endpoint_request">
23802372
: <dfn>client_id</dfn>
23812373
:: The [=RP=]'s unique identifier from the [=IDP=].
2382-
: <dfn>nonce</dfn>
2383-
:: The request nonce.
23842374
: <dfn>account_id</dfn>
23852375
:: The account identifier that was selected.
23862376
: <dfn>is_auto_selected</dfn>
@@ -2417,7 +2407,7 @@ Origin: https://rp.example/
24172407
Content-Type: application/x-www-form-urlencoded
24182408
Cookie: 0x23223
24192409
Sec-Fetch-Dest: webidentity
2420-
account_id=123&client_id=client1234&nonce=Ct60bD&disclosure_text_shown=true&fields=name,email,picture&disclosure_shown_for=name,email,picture
2410+
account_id=123&client_id=client1234&disclosure_text_shown=true&fields=name,email,picture&disclosure_shown_for=name,email,picture
24212411
```
24222412
</div>
24232413

0 commit comments

Comments
 (0)