MCPcopy
hub / github.com/authlib/authlib / test_invalid_scope

Function test_invalid_scope

tests/django/test_oauth2/test_password_grant.py:66–81  ·  view source on GitHub ↗
(factory, server)

Source from the content-addressed store, hash-verified

64
65
66def test_invalid_scope(factory, server):
67 server.scopes_supported = ["profile"]
68 request = factory.post(
69 "/oauth/token",
70 data={
71 "grant_type": "password",
72 "username": "foo",
73 "password": "ok",
74 "scope": "invalid",
75 },
76 HTTP_AUTHORIZATION=create_basic_auth("client-id", "client-secret"),
77 )
78 resp = server.create_token_response(request)
79 assert resp.status_code == 400
80 data = json.loads(resp.content)
81 assert data["error"] == "invalid_scope"
82
83
84def test_invalid_request(factory, server):

Callers

nothing calls this directly

Calls 3

create_basic_authFunction · 0.85
postMethod · 0.80
create_token_responseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…