MCPcopy
hub / github.com/authlib/authlib / test_invalid_client

Function test_invalid_client

tests/django/test_oauth2/test_refresh_token.py:54–72  ·  view source on GitHub ↗
(factory, server)

Source from the content-addressed store, hash-verified

52
53
54def test_invalid_client(factory, server):
55 request = factory.post(
56 "/oauth/token",
57 data={"grant_type": "refresh_token", "refresh_token": "foo"},
58 )
59 resp = server.create_token_response(request)
60 assert resp.status_code == 401
61 data = json.loads(resp.content)
62 assert data["error"] == "invalid_client"
63
64 request = factory.post(
65 "/oauth/token",
66 data={"grant_type": "refresh_token", "refresh_token": "foo"},
67 HTTP_AUTHORIZATION=create_basic_auth("invalid", "client-secret"),
68 )
69 resp = server.create_token_response(request)
70 assert resp.status_code == 401
71 data = json.loads(resp.content)
72 assert data["error"] == "invalid_client"
73
74
75def test_invalid_refresh_token(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…