Wrong redirect when using self-hosted Kratos
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- nextjs, typescript
調査の方向性
packages/nextjs/src/utils/rewrite.ts のリンクされた matching ロジックから始め、self-hosted の Kratos 設定と、異なる auth ドメインおよび application ドメインを使用したフローを再現します。設定された UI URL に対する想定されるリダイレクト動作を確認し、リポジトリにその仕組みがある場合は対象を絞ったカバレッジを追加または更新し、そのフローが backend URL に誤ってフォールバックしなくなったことを検証します。
索引モデルが issue の本文から書いたものです。
説明
Hello!
I'm not sure if I am doing something wrong, but it seems there is an assumption here that may not be correct in cases of self-hosted Kratos:
https://github.com/ory/elements/blob/fdabadf8cb2e0ec4fd9286a5277516f8fd69aa0c/packages/nextjs/src/utils/rewrite.ts#L32C1-L32C62
In my Kratos config, I have:
kratos:
kratos:
config:
serve:
public:
base_url: https://auth.example.com
cors:
allowed_origins:
- http://localhost:3042
- https://auth.example.com
selfservice:
default_browser_return_url: https://example.com
allowed_return_urls:
- http://localhost:3042/*
- https://example.com/*
methods:
webauthn:
config:
rp:
id: example.com
origin: https://example.com:443/auth/login
flows:
error:
ui_url: https://example.com/error
settings:
ui_url: https://example.com/settings
recovery:
ui_url: https://example.com/auth/recovery
verification:
ui_url: https://example.com/auth/verification
after:
default_browser_return_url: https://example.com
logout:
after:
default_browser_return_url: https://example.com
login:
ui_url: https://example.com/auth/login
registration:
ui_url: https://example.com/auth/registration
Every time I start a flow, I get redirected to the UI URLs specified in the config, as-is.
In the linked code above, we can see it tries to match the base URL (let's say https://auth.example.com with the redirect https://example.com/auth/login). Of course, this do not match, it gives up and returns the URL as-is from the backend. It seems a bit weird to me that Ory HAS to be hosted on the same domain as the actual app handling the flows. I suppose this is something specific to the hosted version of Kratos/Ory services, and I also suppose the headers passed are supposed to mitigate this issue, but they do not have any effects in the self-hosted version, it seems.
I'm absolutely open to making a PR if required; I just want to make sure there was no oversight on my side first!
Thanks a lot.
- 主要言語
- TypeScript
- スター
- 187
- フォーク
- 79
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ory/elements のほかの issue
-
Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
good first issue help wanted upstream
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
good first issue help wanted upstream
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
Needs Triage
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
似ている issue
-
ai-driven-qa bug claude Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
linagora/twake-contacts-frontend#241 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
ui(ListToolbar): search takes the full row on a phone instead of sharing it with the result countオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
priority:high
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ahmedkhaleel2004/gitdiagram#228 ·