Issue with OAuth2 credential and Strava


I’m trying to setup an OAuth2 credential with Strava API. When trying to connect, the redirection to Strava works, but the callback fails with the error message:

code: 0
message: "HTTP status 400"
hint: ""

Some details about my setup:

  • I’m using n8n 0.152.0
  • My config (based on the Server install docs with docker-compose running in a VPS):

(I’m skipping traefik config for brevity)

    image: n8nio/n8n
    restart: always
      - ""
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n
      - /home/deploy/app/n8n/local-files:/files

The Strava API parameters are correct, here’s a screenshot of my setup:

Also the callback is properly set in Strava API settings (only the domain).

I also tested this setup on and got “Something went wrong”

Anything I can do to make it work?

Thanks for your help

:man_facepalming: I just saw that there’s a Strava node and everything worked well after setting up the Strava credential type.

I’m not sure the issue presented here applies to all Oauth2 flows though, might be worth checking.

Ok, this post still applies because the Strava node doesn’t expose the Streams endpoints. I tried then to use a HTTP Request with the Strava credential and OAuth2 selected, but n8n doesn’t allow me to select that credential.

Change the authentication to “Body” and try it again.

Thank you, @RicardoE105. Changing auth to body solved the issue.

1 Like

I have a question @RicardoE105, does an OAuth2 type of credential refresh tokens automatically? Because I’m having to refresh it manually for this case. But when using Strava node, I don’t need to.


Yes, it does it automatically. However, with the Strava node, we use a parameter that is not exposed in the HTTP node. Out of the nodes we have, only four use and need the parameter includeCredentialsOnRefreshOnBody. If you want automatic refreshing, you will need to use the Strava node. I guess you are not using the Strava node because the resource/operation you need is unavailable. You can make a feature request here in the community to add missing functionality.

Ok, thanks for clarifying. I already voted on a feature that was requesting the ability to use, for example, Strava credentials on a HTTP Request node, and not the generic OAuth2 credential. Maybe one day :slight_smile:


Hi @RicardoE105,

I decided to add the endpoint myself. Hope it can be merged soon. Thanks