Replies: 2 comments
-
what I did so far:
I also checked the example for github oauth - https://github.com/poem-web/poem/blob/7c9cff63afd54da62d637d49a91d7eb806b4a446/examples/openapi/auth-github/src/main.rs Here is the screenshot from swagger UI: Why client_id and client_secret are required? I would expect to embed them somewhere into the code?
|
Beta Was this translation helpful? Give feedback.
-
Update: added endpoint
I am using
This will initiate oauth flow with google, and at the end it will redirect to
At the end of /redirect handler we have access_token and userinfo from google API and we can store it to the session, cookie. etc... So, basically I have dirty solution which probably needs some improvements. CSFR check is not perfirmed, pkce_verifiers also should be accessible in /redirect handler, client is created twice... Also, maybe there is a way to use some poem structs to communicate with googleAPI insted of using |
Beta Was this translation helpful? Give feedback.
-
I already have service that supports api_key authorization:
I would like to add oauth2 (to support
login with google account
).There is an option for SecurtySchema
ty = oauth2
but I couldn't find any example.I am not sure where/how to use data provided by google:
Beta Was this translation helpful? Give feedback.
All reactions