Hi All,
I just wanted to share with everyone how I was able to integrate Oauth2 for Paypal since Emmanuel spent a good deal of time with me over email to fix the issues I was having. Keep in mind that this pertains only to Paypal, however some of the notes I make below could carry over to other applications.
The initial issue I was having was that Bubble was not recognizing the access token from Paypal because Paypal uses Basic Auth in order to request the token. This functionality was missing from Bubble and was added by Emmanuel throughout our triaging of the issue. Otherwise, we were just doing some trial and error testing to get the setup right in the API connector panel. In general, please follow the below instructions to set up paypal properly:
You must have a valid Paypal developer account in order to add this functionality. Once you set up a developer account, you will receive “sandbox” credentials to test the functionality.
This tripped me up the most…the redirect URL that you place in your Paypal developer dashboard must be the URL for the same page in in which the link to your paypal authorization resides. E.g., if you click on a button on http://www.mysite.com/signin, the redirect URL in your paypal developer dashboard must be that exact link and nothing different or else you will get a relying party validation error and not see the Paypal login. Also, once you place the redirect URL in the appropriate box it might take up to 3 hours for the settings to take effect.
You must ensure that when you initially set up the Oauth2 authorization call you DO NOT add any sequential page actions in the workflow panel or else you won’t get the success message that you set up the Oauth2 connection correctly with Paypal.
Finally, please find below the proper parameters to use in the API connector panel:
-Scope: openid
-Authentication goes in the header-checked
-APi uses the refresh token mechanism-checked
-Request an access token uses Basic Auth-checked
-App ID: Comes from Paypal dev dashboard
-client secret: Same as above
-Login dialog redirect: https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize
-Access token endpoint: https://api.sandbox.paypal.com/v1/oauth2/token
-User Profile endpoint: https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo?schema=openid
-User ID key path: user_id
-User email key path: email
This should clear up a lot but if anyone has any further questions feel free to post here or message me personally. Thanks!