MCPcopy
hub / github.com/authlib/authlib / test_invalid_assertion

Function test_invalid_assertion

tests/flask/test_oauth2/test_jwt_bearer_grant.py:64–77  ·  view source on GitHub ↗
(test_client)

Source from the content-addressed store, hash-verified

62
63
64def test_invalid_assertion(test_client):
65 assertion = JWTBearerGrant.sign(
66 "foo",
67 issuer="client-id",
68 audience="https://provider.test/token",
69 subject="none",
70 header={"alg": "HS256", "kid": "1"},
71 )
72 rv = test_client.post(
73 "/oauth/token",
74 data={"grant_type": JWTBearerGrant.GRANT_TYPE, "assertion": assertion},
75 )
76 resp = json.loads(rv.data)
77 assert resp["error"] == "invalid_grant"
78
79
80def test_authorize_token(test_client):

Callers

nothing calls this directly

Calls 2

postMethod · 0.80
signMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…