Skip to content

OpenID with Azure AD is returning invalid_request #4336

Description

@ccy1ju

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I am setting up BookStack in docker containers, and I want to have the SSO with Azure AD trough OpenID, so far this is the docker compose file:


volumes:
  db:
    external: true
    name: bookstack_db_data
  app:
    external: true
    name: bookstack_app_data

services:
  nginx-proxy:
    restart: unless-stopped
    image: {registry}/twc7fe/jwilder-nginx-proxy:v1
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /local/home/app1/certificates:/etc/nginx/certs

  bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    expose:
      - "80"
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://example.com
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=123456
      - DB_DATABASE=bookstackapp
      - VIRTUAL_HOST=example.com
      - VIRTUAL_PORT=80
      - AUTH_METHOD=oidc
      - AUTH_AUTO_INITIATE=false
      - OIDC_NAME=SSO
      - OIDC_DISPLAY_NAME_CLAIMS=preferred_username
      - OIDC_CLIENT_ID=client_id
      - OIDC_CLIENT_SECRET="password"
      - OIDC_ISSUER="https://login.microsoftonline.com/{tenant}/v2.0"
      - OIDC_ISSUER_DISCOVER=true
      - OIDC_DUMP_USER_DETAILS=true
      - APP_DEBUG=true
      - CURL_CA_BUNDLE=/certs/cacert.pem
    volumes:
      - app:/config
      - /local/home/app1/docker-compose/bookstack/cacert:/certs
    networks:
      - default
    restart: unless-stopped
    depends_on:
      - bookstack_db

  bookstack_db:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=123456
      - TZ=Europe/London
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=123456
    volumes:
      - db:/config
    networks:
      - default
    restart: unless-stopped

networks:
  default:
    external: true
    name: bookstack

But when I try to connect I am getting this error
production.ERROR: invalid_request {"exception":"[object] (League\OAuth2\Client\Provider\Exception\IdentityProviderException(code: 400): invalid_request at /app/www/app/Auth/Access/Oidc/OidcOAuthProvider.php:104)
With no further information.
The tenant, client and secret are correct, only the secret and the issuer are in quotes, and I tried without quotes as well, and encoding. I know I have connectivity to Azure AD because I could set the Azure AD as a third party login, but I don't want the users to be able to register themselves, instead I would give them access directly in Azure AD.
I've been the whole day here and I have no clue.
Does anyone know why this is happening?

Thanks in advance.

Exact BookStack Version

v23.05.2

Log Content

production.ERROR: invalid_request {"exception":"[object] (League\OAuth2\Client\Provider\Exception\IdentityProviderException(code: 400): invalid_request at /app/www/app/Auth/Access/Oidc/OidcOAuthProvider.php:104)

PHP Version

8.2.7

Hosting Environment

RHEL 8 server, but inside docker containers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions