MCPcopy Create free account
hub / github.com/authlib/authlib / server

Function server

tests/django/test_oauth2/test_authorization_code_grant.py:19–39  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

17
18@pytest.fixture(autouse=True)
19def server(server):
20 class AuthorizationCodeGrant(CodeGrantMixin, grants.AuthorizationCodeGrant):
21 TOKEN_ENDPOINT_AUTH_METHODS = [
22 "client_secret_basic",
23 "client_secret_post",
24 "none",
25 ]
26
27 def save_authorization_code(self, code, request):
28 auth_code = OAuth2Code(
29 code=code,
30 client_id=request.client.client_id,
31 redirect_uri=request.payload.redirect_uri,
32 response_type=request.payload.response_type,
33 scope=request.payload.scope,
34 user=request.user,
35 )
36 auth_code.save()
37
38 server.register_grant(AuthorizationCodeGrant)
39 return server
40
41
42@pytest.fixture(autouse=True)

Callers

nothing calls this directly

Calls 1

register_grantMethod · 0.80

Tested by

no test coverage detected