ory / ory/elements

Support separate URLs for server/client side connection to Kratos

Open
#595 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Triage
Dominant language
TypeScript
Stars
187
Forks
80
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

No response

Describe your problem

In a self-hosted environment with limited outbound connectivity, it may not be possible for the login (NextJS) server to communicate with Kratos via the public internal URL. Currently the env (NEXT_PUBLIC_)ORY_SDK_URL affects both the server- and client-side connections.

Describe your ideal solution

I would like to be able to specify a public URL https://example.com so that the browser can connect to Kratos public endpoints at https://example.com/self-service/... etc., and also an "internal" URL http://kratos-public that the NextJS server app can use to make connections directly within the same internal network.

Workarounds or alternatives

I have tried setting the external URL in the ory.config.ts file to the public URL and passing the private URL to the server with ORY_SDK_URL, but the browser still ends up redirecting the user to the private URL, which is unreachable.

Version

@ory/nextjs/1.0.0-rc.1

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the @ory/nextjs configuration and every use of ORY_SDK_URL, then trace how server requests and browser redirects are configured. Done means the server can use an internal Kratos URL while the browser uses the public URL for self-service endpoints, without redirecting to the internal address.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
authentication, full-stack
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.