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

Function save_authorization_code

tests/flask/test_oauth2/models.py:100–116  ·  view source on GitHub ↗
(code, request)

Source from the content-addressed store, hash-verified

98
99
100def save_authorization_code(code, request):
101 client = request.client
102 auth_code = AuthorizationCode(
103 code=code,
104 client_id=client.client_id,
105 redirect_uri=request.payload.redirect_uri,
106 scope=request.scope,
107 nonce=request.payload.data.get("nonce"),
108 user_id=request.user.id,
109 code_challenge=request.payload.data.get("code_challenge"),
110 code_challenge_method=request.payload.data.get("code_challenge_method"),
111 acr="urn:mace:incommon:iap:silver",
112 amr="pwd otp",
113 )
114 db.session.add(auth_code)
115 db.session.commit()
116 return auth_code
117
118
119def exists_nonce(nonce, request):

Calls 2

AuthorizationCodeClass · 0.85
getMethod · 0.45