| 98 | |
| 99 | |
| 100 | def 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 | |
| 119 | def exists_nonce(nonce, request): |