Skip to content

Commit 84b308d

Browse files
cbiesingerchromium-wpt-export-bot
authored andcommitted
[FedCM] Make sure disclosure_text_shown is correct with the scopes API
Bug: 338574387 Change-Id: Ic675cfa848688d0d0f0ed14792ee22735a29adf0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526980 Reviewed-by: Yi Gu <[email protected]> Commit-Queue: Christian Biesinger <[email protected]> Cr-Commit-Position: refs/heads/main@{#1298645}
1 parent 71346ae commit 84b308d

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<title>Federated Credential Management API network request tests.</title>
3+
<link rel="help" href="https://fedidcg.github.io/FedCM">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/resources/testdriver.js"></script>
7+
<script src="/resources/testdriver-vendor.js"></script>
8+
9+
<body>
10+
11+
<script type="module">
12+
import {fedcm_test,
13+
request_options_with_mediation_required,
14+
fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js';
15+
16+
fedcm_test(async t => {
17+
let options = request_options_with_mediation_required("manifest_check_disclosure_shown_false.json");
18+
options.identity.providers[0].clientId = "0";
19+
options.identity.providers[0].scope = ["non_default_scope"];
20+
const cred = await fedcm_get_and_select_first_account(t, options);
21+
assert_equals(cred.token, "token");
22+
assert_equals(cred.isAutoSelected, false);
23+
}, "We should send disclosure_text_shown=false when custom scopes are passed.");
24+
25+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"accounts_endpoint": "accounts.py",
3+
"client_metadata_endpoint": "client_metadata.py",
4+
"id_assertion_endpoint": "token_check_disclosure_shown_false.py",
5+
"login_url": "login.html"
6+
}
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import importlib
2+
error_checker = importlib.import_module("credential-management.support.fedcm.request-params-check")
3+
4+
def main(request, response):
5+
request_error = error_checker.tokenCheck(request)
6+
if (request_error):
7+
return request_error
8+
9+
if request.POST.get(b"disclosure_text_shown") != b"false":
10+
return (560, [], "disclosure_text_shown is not false")
11+
12+
response.headers.set(b"Content-Type", b"application/json")
13+
response.headers.set(b"Access-Control-Allow-Origin", request.headers.get(b"Origin"))
14+
response.headers.set(b"Access-Control-Allow-Credentials", "true")
15+
16+
return "{\"token\": \"token\"}"

0 commit comments

Comments
 (0)