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

Function generate_authorization_code

tests/django/test_oauth2/models.py:143–155  ·  view source on GitHub ↗
(client, grant_user, request, **extra)

Source from the content-addressed store, hash-verified

141
142
143def generate_authorization_code(client, grant_user, request, **extra):
144 code = generate_token(48)
145 item = OAuth2Code(
146 code=code,
147 client_id=client.client_id,
148 redirect_uri=request.payload.redirect_uri,
149 response_type=request.payload.response_type,
150 scope=request.payload.scope,
151 user=grant_user,
152 **extra,
153 )
154 item.save()
155 return code

Callers

nothing calls this directly

Calls 2

generate_tokenFunction · 0.90
OAuth2CodeClass · 0.85

Tested by

no test coverage detected