'https' missing from OAUTH2 callback URL

Describe the problem/error/question

While this hasn’t been a problem in the past with other credentials that require it, I now have one that fails without the https prepended to the callback URL. Is there a way to get the callback URL that is passed with the initial authorization to include “https”?

I have N8N_PROTOCOL set to https and it is also included in the WEBHOOK_URL variable.

Information on your n8n setup

  • n8n version: 0.221.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): queue mode
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: unknown linux distro

Hey @mbowler,

The protocol is added to the oauth callback URL from the WEBHOOK_URL it sounds like maybe it isn’t set properly or wasn’t stopped then started after making the change.

Can you double check the WEBHOOK_URL option and confirm it includes the protocol, If it is set can you share your full configuration with anything sensitive removed so we can test.

Hey Jon. Sorry for the huge delay. Got pulled into some other projects. Consequently, I have discovered that this is also affection auth with Google Cloud Projects.

Here is the config for my main instance

version: '3'
services:
  n8n:
    # image: n8nio/n8n:${SOFTWARE_VERSION_TAG}
    build:
      context: .
    restart: always
    environment:
      N8N_BASIC_AUTH_ACTIVE: 'false'
      N8N_AUTH_EXCLUDE_ENDPOINTS: api:webhook:webhook-test
      N8N_HOST: my.hostname.com (redacted, but in this same format)
      N8N_PROTOCOL: https
      N8N_PORT: 5678
      N8N_EDITOR_BASE_URL: my.hostname.com (redacted, but in this same format)
      N8N_EMAIL_MODE: 'smtp'
      N8N_SMTP_HOST: '172.17.0.1'
      N8N_SMTP_PORT: '25'
      N8N_SMTP_USER: ' '
      N8N_SMTP_PASS: ' '
      N8N_SMTP_SENDER: '[email protected]'
      N8N_SMTP_SSL: 'false'
      WEBHOOK_URL: https://my.hostname.com (redacted, but in this same format)
      NODE_FUNCTION_ALLOW_EXTERNAL: '*'
      NODE_FUNCTION_ALLOW_BUILTIN: '*'
      DB_TYPE: postgresdb
      DB_POSTGRESDB_DATABASE: n8n
      DB_POSTGRESDB_HOST: postgres
      #DB_POSTGRESDB_PORT: 34523
      DB_POSTGRESDB_USER: postgres
      DB_POSTGRESDB_PASSWORD: ${DB_PASSWORD}
      EXECUTIONS_MODE: queue
      QUEUE_BULL_REDIS_HOST: ${REDIS_HOST}
      QUEUE_BULL_REDIS_PORT: 23647
      QUEUE_BULL_REDIS_PASSWORD: ${REDIS_PASSWORD}
      N8N_LOG_LEVEL: debug
    dns: 
        - 8.8.8.8
    ports:
      - 172.17.0.1:5678:5678
    volumes:
      - ./.n8n:/home/node/.n8n
      - ./n8n-backups:/data/backups
      - /local-files:/home/node/files
    depends_on:
     postgres: 
      condition: service_healthy
      
  postgres:
    image: postgres:${POSTGRES_VERSION_TAG}
    shm_size: 1g
    container_name: postgres
    restart: always
    command: -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      PGDATA: /var/lib/postgresql/data
      TS_TUNE_MAX_CONNS: 100
    volumes:
      - /opt/app/data:/var/lib/postgresql/data
    ports:
      - '34523:5432'
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -h localhost -U postgres -d postgres']
      interval: 5s
      timeout: 5s
      retries: 10
      
  pgadmin4:
    image: dpage/pgadmin4:latest
    container_name: pgadmin4
    restart: always
    environment:
      PGADMIN_DEFAULT_EMAIL: [email protected]
      PGADMIN_DEFAULT_PASSWORD: ${DB_PASSWORD}
      PGADMIN_LISTEN_PORT: 443
      PGADMIN_ENABLE_TLS: 1  
    ports:
      - "34343:443"
    volumes:
      - /opt/app/pgadmin/servers.json:/pgadmin4/servers.json
      - /opt/app/pgadmin/storage/matt_practiceamigo.com/pgpass:/pgadmin4/pgpass
      - /root/.acme.sh/vm.elestio.app/fullchain.cer:/certs/server.cert
      - /root/.acme.sh/vm.elestio.app/vm.elestio.app.key:/certs/server.key

This is the configuration of the workers

version: "3"
services:
  n8n:
    #image: n8nio/n8n:${SOFTWARE_VERSION_TAG}
    build:
      context: .
    restart: always
    command: /bin/sh -c "sleep 5; n8n worker"
    environment:
      NODE_FUNCTION_ALLOW_EXTERNAL: "*"
      NODE_FUNCTION_ALLOW_BUILTIN: "*"
      DB_TYPE: postgresdb
      DB_POSTGRESDB_DATABASE: n8n
      DB_POSTGRESDB_HOST: ${POSTGRES_HOST}
      DB_POSTGRESDB_PORT: 34523
      DB_POSTGRESDB_USER: postgres
      DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
      EXECUTIONS_MODE: queue
      QUEUE_BULL_REDIS_HOST: ${REDIS_HOST}
      QUEUE_BULL_REDIS_PORT: 23647
      QUEUE_BULL_REDIS_PASSWORD: ${REDIS_PASSWORD}
      N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
      N8N_LOG_LEVEL: debug
      WEBHOOK_URL: https://my.hostname.com (redacted, but in same format)

Hey @mbowler,

That setup looks like what I have in mine apart from the N8N_EDITOR_BASE_URL, We should be picking up the value from the WEBHOOK_URL option so it still feels like that option is not set correctly or maybe isn’t being picked up unless N8N_EDITOR_BASE_URL is overwriting it, Have you tried adding https:// to the start of that as well?

Bingo! Looks like that did it. Not sure why I didn’t try that. Hindsight 20/20 and all…

Thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.