[New Feature - Beta] API Connector and OAuth2 APIs

Only the initial set up of course. General users don’t need the debugger to be on obviously.

@emmanuel

I’m trying to setup an API that requires a State query parameter (random string that I generate in my system to identify the request).

Is this possible with the beta version? If not, is it something that can be added?

Thanks

The state querystring is something we need to use behind the scene to make authentication work, that’s unfortunately not something we can expose right now.

Hello everyone,

Has anyone tried authenticating with PayPal yet? I’m trying to authenticate with Paypal so that I can eventually post payments to users’ accounts through the API. I’m however having some issues setting this up. Please see below a screenshot of my setup screen:

I am using the following pieces of information to set this up:

-Login dialog redirect: Sorry about that
-Access Token endpoint: https://api.sandbox.paypal.com/v1/oauth2/token
-User profile endpoint: https://api.sandbox.paypal.com/v1/identity/openidconnect/userinfo
-Scope: openid

Can anyone who has gotten this to work let me know if I am doing something wrong? Thanks!

1 Like

So what happens when you try to sign up in run mode with the debugger present?

Hi Emmanuel, when I try to sign up/log in with the debugger present, I never am able to actually reach the Paypal user sign up page where a user can input their username and password. When I click the sample red “edit me” button below that should bring me to the Paypal user signup/login page, the blue bar near the address bar keeps loading at the top of the screen endlessly and I never ultimately get there:

What is interesting is that a couple of days ago (with the same settings) I used to be able to reach that Paypal login screen, but after logging in with Paypal and the authentication seemingly working correctly, I got the following set of errors from Bubble:

API Connector error: the Oauth2 API apiconnector-GzT is not configured properly - {“args”:{“body”:“{"error":"invalid_client","error_description":"Client credentials are missing"}”,“path”:“”,“method”:“POST”,“data”:“”,“url”:“https://api.sandbox.paypal.com/v1/oauth2/token",“uri”:"”}}

My initial thought was that the login access redirect URL for Paypal was down for some reason, but if I copy and paste that particular URL from the API connector plugin settings tab in Bubble to the address bar in my browser, it does reach at least a Paypal screen with an error that the client ID is wrong, which means that link is working.

I’ve also found out that Paypal uses Oauth2 for authentication purposes: https://developer.paypal.com/docs/integration/direct/paypal-oauth2/

Let me know what you/the rest of the forum thinks of this. Thanks!

-Jonathan

Can you share a link in run mode?

Turns out it was a bug on our end, we’ll push a fix within 2 hours.

1 Like

Thanks Emmanuel and team! If you guys need any more info from me or have any other questions please let me know and I would be glad to provide!

This feature is amazing @emmanuel - just got it to work with mailchimp :slight_smile: In fact I think that your psychic, I was literally planning to ask for this feature

Hey Emmanuel, just an update. Thanks for fixing that bug, as I’ve been able to reach the paypal screen and login with my username and password. I know I’m probably making a mistake on my part, but I still get the following error message after authenticating with paypal:

I’ve read the paypal api documentation in depth and feel the setup is right, but of course I could always be making a mistake. Just want to verify with you this is definitely an error on my part and not any bug remaining. Thanks!

That means the initialization process hasn’t happened yet. Did you get the alert saying “You have successfully initialized the OAuth2 connection for Paypal”? in run mode?

I wasn’t able to get that message, so it’s very likely that I’m not configuring the authentication API call correctly. Here’s a screenshot of my latest setup:

I was under the impression that the simple act of signing in and authenticating with Paypal on the front end means that you have initialized the Oauth2 connection with Paypal correctly for Bubble’s purposes and then can build the API calls from there. If that’s not the case and you need to have the proper authentication-related API calls set up in order to achieve this, then I apologize it’s my mistake and I need to do a little more due diligence in the API documentation. I think I’m possibly not setting up the authentication token call correctly.

Can you see if you’re being signed up with paypal at the individual account level? You should have a list of apps there.

Yes, I logged into the same Sandbox paypal account that I used to authenticate with my Bubble application and it shows the following in my settings panel:

Log in with PayPal

You’ve agreed to share some of your info with these merchants. We never share your financial info and you can remove a merchant from this list at any time.

Merchant You’re sharing
Piershare Profile Info Delete

Also, I looked at the Paypal api documentation and it says there is a three step process with authenticating with Paypal properly, and I partly feel that what may be causing this is that I have not properly set up the authentication related API calls with Paypal even though my account has been authenticated correctly. Check out the integration steps section at the bottom of the page in the following hyperlink if you’re interested:

https://developer.paypal.com/docs/integration/direct/identity/log-in-with-paypal/

@emmanuel

How do we access the access token generated initially in the api calls which require passing that as a parameter.
I am looking at this instagram api endpoint (Instagram Platform - Documentation - Meta for Developers).

Note: Instagram has oauth 2.0 authentication which I could get to work. But unable to initialize any calls (see attached error) due to lack of access token info.

Can you email us with a sandbox account we can use to try?

We don’t expose the access_token for security reasons, it should be done automatically. Did you set the right setting regarding where the token should go (URL VS headers). If so can you share a link?

Just direct messaged you the editor link