Files
marqdo/ext/security/oidc.mq.md
T
cflmyandCursor e9c1a8a730 feat(web): resolve OIDC redirect_uri from request Host
Allow path-style redirect_uri (/oidc/callback) so apex/www and
proxied HTTPS share one config; persist the absolute URI for token exchange.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-08 11:35:12 +08:00

1.4 KiB


title: ext/security/oidc description: OIDC attach helper for app handles (ADR 0007). Prefer declared auth metadata on Endpoints. import plugin:lib/plugin.mq.md import sys:lib/sys.mq.md

_load

p = > plugin.native_path name="web"

  1. p

plugin.load path=p

print text=ext/security: native web plugin not found sys.exit code=1


attach

+ `app`
+ `issuer`=None
+ `client_id`
+ `client_secret`
+ `redirect_uri`
+ `redirect_origins`=None
+ `scopes`="openid profile email"
+ `callback_path`=None
+ `authorize_url`=None
+ `token_url`=None
+ `userinfo_url`=None

redirect_uri may be an absolute URL (https://qdqc.com/oidc/callback) or a path (/oidc/callback). Path mode resolves the absolute callback from the login request Host (X-Forwarded-Proto / X-Forwarded-Host when behind a reverse proxy) and stores it in the session so token exchange uses the same string.

Optional redirect_origins is a comma-separated allowlist (https://qdqc.com,https://www.qdqc.com). When set, path-mode origins must match. The IdP must still register every absolute callback URL that will be used.

_load > web_app_oidc app=app issuer=issuer client_id=client_id client_secret=client_secret redirect_uri=redirect_uri redirect_origins=redirect_origins scopes=scopes callback_path=callback_path authorize_url=authorize_url token_url=token_url userinfo_url=userinfo_url