Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sudden Redirect #52665

Open
a-b-v opened this issue Mar 1, 2025 · 1 comment
Open

Sudden Redirect #52665

a-b-v opened this issue Mar 1, 2025 · 1 comment

Comments

@a-b-v
Copy link

a-b-v commented Mar 1, 2025

There are two applications: a frontend and a backend behind Teleport. The domains are ui.mteleport.com and back.mteleport.com.

The frontend sends a request to back.mteleport.com/adm/graph with the header Authorization: Bearer. The preflight request completes successfully, returning 200 and the Access-Control-Allow-Origin header.

However, the subsequent fetch request returns 302 to address https://mteleport.com:443/web/launch/back.mteleport.com?path=%2Fadm%2Fgraph without the Access-Control-Allow-Origin header and is blocked by the browser.

Application Configurations:

- name: "ui"
  uri: "http://ui.test"
  required_apps:
    - "back"
- name: "back"
  uri: "http://back.test"
  cors:
    allowed_origins:
      - "https://ui.mteleport.com"
    allowed_headers:
      - "Authorization"
      - "Content-Type"

Expected behavior:

The request returns 200.

Current behavior:

The request returns 302.

Bug details:

@avatus
Copy link
Contributor

avatus commented Mar 1, 2025

Looking at your config, and seeing that the preflight is returned successfully makes me think that you have Teleport configured correctly.

Because you're receiving a 302 to the authentication page, that means Teleport is not receiving your credentials on the fetch request. Is your frontend request configured with "credentials: include"? https://goteleport.com/docs/enroll-resources/application-access/guides/connecting-apps/#cors-support-for-preflight-requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants