Skip to content

OpenID causes infinite redirect loop #618

Description

@lilioid

Issue Summary

I have tried setting up a fresh alerta using OpenID-Connect as the only auth source. Doing so causes an infinite redirect loop inside the authentication popup. From alerta to the auth provider, back to alerta, back to the auth provider and so forth.

Environment

  • OS: Linux

  • API version: 9.1.0 (using the alerta-web 9.1.0 image)

  • Deployment: Docker

  • Database: MongoDB

  • Server config:
    Auth enabled? Yes
    Auth provider? OpenID / Keycloak (problem appears on both)
    Customer views? No
    (or provide the /config endpoint output)

  • web UI version: (using the alerta-web 9.1.0 image)

  • CLI version: (using the alerta-web 9.1.0 image)

To Reproduce
Steps to reproduce the behavior:

  1. Go to /login on the instance
  2. Grant the apps request to open a popup
  3. Popup opens and navigates to the auth providers authentication endpoint
  4. Auth provider redirects back to alerta on URL / (still in the popup)
  5. Alerta does not recognize the auth providers GET parameters in the URL and initiates a new login, thus redirecting back to the auth provider
  6. Steps 4 and 5 repeat indefinitely

Workaround

When the popup is open, a reload of the original browser tab (which is on /login) results in the authentication succeeding, the popup closing, and me being logged in successfully.

Browser Logs

This message gets logged every time alerta initiates a new login process.

Navigated to https://id.example.com/realms/<redacted>/protocol/openid-connect/auth?response_type=code&client_id=alerta&redirect_uri=https://alerta.example.com/&scope=openid+profile+email&display=popup&state=<redacted>

Expected behavior

Login should just work without needing a workaround and without being stuck in an infinite redirect loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions