You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There were certain problems that I faced during this process. Unlike in docs I am not using any package for authentication. So, I had to strip down the code to bare minimum so below code is for creating client secret and validating the authorization_code.
Problem was with identity_token or authorization_code by client side
- In docs, access_token was mentioned and all that client side can provide was identity_token or authorization_code or both. Here I have used authorization_code.
How to use PRIVATE_KEY securely(maybe not a part that docs is related to). I have stored PRIVATE_KEY in my env file. I have just appended the private key into a single line and later on strip to get raw PRIVATE_KEY
Decoding of the id_token.During the time docs was made may be it was correct but the code mention in code didn't worked for me so I had to update the decoding processing.
Here is the updated code for backend.
There were certain problems that I faced during this process. Unlike in docs I am not using any package for authentication. So, I had to strip down the code to bare minimum so below code is for creating
client secret
andvalidating
theauthorization_code
.Problem was with
identity_token
orauthorization_code
by client side- In docs,
access_token
was mentioned and all that client side can provide wasidentity_token
orauthorization_code
or both. Here I have usedauthorization_code
.How to use
PRIVATE_KEY
securely(maybe not a part that docs is related to). I have stored PRIVATE_KEY in myenv file
. I have just appended the private key into a single line and later on strip to get raw PRIVATE_KEYDecoding of the
id_token
.During the time docs was made may be it was correct but the code mention in code didn't worked for me so I had to update the decoding processing.PY JWT reading the claim without validation
Things to remember:
authorization_code
is 1 time thing, create new one every time you try to login (client side).PRIVATE_KEY
is 1 time thing once you download cannot be downloaded againBelow code only creates
client_secret
and validates theauthorization_code
this is not a complete flowIt only returns email if
authorization_code
is valid otherwise it returns empty dict.The text was updated successfully, but these errors were encountered: