I would like to use my bubble app to authenticate a login via Oauth2 and if user exists then they automatically login to an external website. I have setup the 3rd Party Oauth Access in settings, the token requests are being sent and confirmed by bubble and bubble is replying with the access_token, refresh_token, epiry date, and uid (which is user id).
The problem I have is the website I am trying to login with expects an email address to match an email address they have.
Does anybody know how I can return the email with the initial oauth request as well as the uid OR use the uid and the access_token in an api request to get the logged in user email?
The end game of the user agent process is for Bubble to provide you with the access token, expires in, and uid. This you have as per your post.
Create another endpoint where you run a search for that user’s email by using the user uid. Add the action that returns this information as text. Just set the endpoint as public, require authentication and set privacy rules accordingly. Authenticate as Bearer token using the access token of course.
Hi, thank you for your help previously. So it seems the website I am integrating with sends a GET request with the access_token and not the UID. Do you know if it is possible to search for a user with the access _token that is granted instead of the UID?
This is all automated so I don’t think either of those would work. So my current flow is as follows.
Partner app makes an Oauth call to my app via the 3rd party Oauth setup in bubble.
My app returns with an access_token and a UID.
Partner app uses the access_token in a GET request to my app to search for a user that is associated with the access_token and then expects a return of email in JSON format.
I have no way of changing the partner GET request.