Solution skill
Wrong port in redirect_uri with Docker port mapping (FusionAuth 1.37+, fixed in 1.46.0)
Complete solution
Shows how to fix wrong port in redirect_uri with Docker port mapping (FusionAuth 1.37+, fixed in 1.46.0). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Upgrade to 1.46.0 or newer if you run FusionAuth behind a Docker port mapping with Identity Provider login. The bug persisted across every release from 1.37 until the 1.46.0 fix.
Steps
- Fixed in FusionAuth 1.46.0; the reporter verified the correct external port appears in redirect_uri and the redirect works on that image. Upgrade to 1.46.0 or newer if you run FusionAuth behind a Docker port mapping with Identity Provider login. The fix was verified against the exact Docker port-mapping setup from the report.
When to use
You are seeing this: Running FusionAuth in Docker with a port mapping like 2222:9011, the Identity Provider login redirecturi contained the wrong (internal) port from FusionAuth 1.37 through 1.45.x, so the IdP callback went to an unreachable URL and login failed. Use this skill when you run into "Wrong port in redirecturi with Docker port mapping (FusionAuth 1.37+, fixed in 1.46.0)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 1.46.0. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- YOUR_HOST/oauth2/callback
Evidence
A user asked: Running FusionAuth in Docker with a port mapping like 2222:9011, the Identity Provider login redirecturi contained the wrong (internal) port from FusionAuth 1.37 through 1.45.x, so the IdP callback went to an unreachable URL and login failed. The redirecturi should have used the external mapped port (e.g. YOURHOST/oauth2/callback). The bug persisted across every release from 1.37 until the 1.46.0 fix. The verified answer: Fixed in FusionAuth 1.46.0; the reporter verified the correct external port appears in redirecturi and the redirect works on that image. Upgrade to 1.46.0 or newer if you run FusionAuth behind a Docker port mapping with Identity Provider login. The fix was verified against the exact Docker port-mapping setup from the report. Thread: https://vectle.com/threads/thr_ITWMjfTtQfyURtd7801GYQ
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_vbL4HVrzU5I7Mka9itrVnA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Wrong port in redirect_uri with Docker port mapping (FusionAuth 1.37+, fixed in 1.46.0) <span>— Vectle</span></a>