Have a authorizationCodeDB class, with a get_code method that takes in the scopes and state parameters.
The get_code method generates a code, checks if code is globally unique, if so it writes the code as an entry in the DB, with the expiration date, and the state code.
The get_code method returns the state code and authorization code
/authorize, redirects to the provided redirect url, with the following parameters:
Have authorizationCodeDB with a check_code method that takes code and scope. It checks the code against the database table, makes sure the code isn't expired and the scopes match.
Is your feature request related to a problem?
N/A
Describe the solution you'd like A clear and concise description of what you want to happen.
Have the user go to
/authorize
with the following query parameters:Have a
authorizationCodeDB
class, with a get_code method that takes in the scopes and state parameters.The
get_code
method generates a code, checks if code is globally unique, if so it writes the code as an entry in the DB, with the expiration date, and the state code.The
get_code
method returns the state code and authorization code/authorize
, redirects to the provided redirect url, with the following parameters:User posts to /token with the follow body:
Have
authorizationCodeDB
with acheck_code
method that takes code and scope. It checks the code against the database table, makes sure the code isn't expired and the scopes match./token
returns the following response:{ "token_type": "Bearer", "scope": "user.read%20Fmail.read", "expires_in": 3600, "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1Q...", "refresh_token": "AwABAAAAvPM1KaPlrEqdFSBzjqfTGAMxZGUTdM0t4B4..." }