OAuth2 with Auth0 with API-Connector

Hi, I’ve been stuck for a long time trying to use the oauth2-user-agent-flow from the API-CONNECTOR plugin.
The documentation is not good and leaves many gaps open.
Just to clarify, I know the entire user authentication flow using oauth2. So that’s not a problem for me.

Before using the plugin, I performed the entire authentication flow through the bubble with api-connector and command line and everything worked fine to retrieve the token.

I’m using Auth0 identity provider. Soon:

  1. I have successfully set up my account on oauth0

  2. I have successfully configured the api-connector plugin

  3. I was able to authenticate myself by being redirected to the auth0 page successfully

  4. I was redirected to the app with the code successfully

  5. As I understand it, the api-connector plugin should get the code and fetch the token in the same way as we do via the command line, as all the information needed to make the request is configured in the plugin. Below is an example I made via the command line to retrieve my token after authentication

     curl --request POST \
       --url 'https://dev-1d3mpc3w.us.auth0.com/oauth/token' \
       --header 'content-type: application/x-www-form-urlencoded' \
       --data grant_type=authorization_code \
       --data 'client_id=XXX' \
       --data client_secret=XXX \
       --data 'redirect_uri=https://MY_APP.bubbleapps.io/version-test'

The response of this request returns me a JSON like below:

   "scope":"openid profile email offline_access",

The id_token is what I need to send to my api as Authorization header: Bearer ID_TOKEN_HERE,

Problems start from that point

  1. The plugin does not create the token by calling again on the configured endpoint http://dev-1d3mpc3w.us.auth0.com/oauth/token
  2. Authenticated calls do not work as the token is not captured and is not sent

I’ve tried to make several changes to the plugin’s settings and have had no success.

Hi, got the same problem here. Did you find a solution ?

From your description, it sounds like the plugin is not properly capturing the token after the authentication flow has been completed. Have you tried checking the logs to see if there are any error messages that might provide more information about the issue?

@diegohsitec Did you manage to figure that out?