Login via OpenID sending a malformed redirect_uri

snake44

New Member
Mar 6, 2022
2
0
1
29
I'm trying to configure login via OpenID with ory Hydra, but PVE is sending a malformed uri in with the login request. Basically it is sending https://pve.mydomain.com&scope=openid+email+profile&nonce=5MXsrqFcpjJytn890j5p-w&display=page, without the /? after the domain name, so hydra always responds with a 400 error. The hydra server is running behind nginx. Here is a snippet from the log. Is there something I can do to solve this problem?

Code:
{
  "http_request": {
    "headers": {
      ..REDACTED
      "referer": "https://pve.mydomain.com/"
    },
    "host": "hydra-public",
    "method": "GET",
    "path": "/oauth2/auth",
    "query": "response_type=code\u0026client_id=[REDACTED]\u0026state=%7B%22csrf_token%22%3A%22F_xX7MqRY4UAUchLQZvI8A%22%2C%22realm%22%3A%22openid%22%7D\u0026code_challenge=dkafASDfasdfkah2adfnaDFJadksW_jadskSDEFfg\u0026code_challenge_method=S256\u0026redirect_uri=https%3A%2F%2Fpve.mydomain.com\u0026scope=openid+email+profile\u0026nonce=l2qnlkdakfyadslfaaj\u0026display=page",
    "remote": "@",
    "scheme": "http"
  },
  "http_response": {
    "headers": {
      "content-type": "text/html; charset=utf-8",
      "location": "https://accounts.mydomain.com/apps/error?error=invalid_request\u0026error_description=The+request+is+missing+a+required+parameter%2C+includes+an+invalid+parameter+value%2C+includes+a+parameter+more+than+once%2C+or+is+otherwise+malformed.+The+%27redirect_uri%27+parameter+does+not+match+any+of+the+OAuth+2.0+Client%27s+pre-registered+redirect+urls."
    },
    "size": 367,
    "status": 302,
    "text_status": "Found",
    "took": 3060691
  },
  "level": "info",
  "msg": "completed handling request",
  "time": "2022-03-06T23:05:04+01:00"
}
 
How did you configure the valid redirect URIs in hydra?
With or without a trailing slash ('/')?