mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #4852] How to pass the JWT Token for web authentication after v2.13.1? #3049
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#3049
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @moutasem1989 on GitHub (Nov 7, 2025).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4852
Since there is no OIDC/SSO Authentication yet, I use Authentik Proxy Authentication to sign into NPM Web UI.
In Authentik group Attributes I added
Attributes can be also added to individual users. The Property Mapping Expression must be adjusted accordingly.
Then created a Property Mappings for NginX to obtain the JWT Token from NPM API:
Name:
NginX TokenScope Name:
ak_proxyExpression:
Create Authentik Application and Proxy Provider for NPM. Make sure to add the application to Authentik Outpost. Add
NginX Tokento Selected Scopes.In NPM Proxy Host, I had this configuration:
This part fetches the JWT Token from Authentik Scope and passes it as a header:
Up to
v2.13.1this worked smoothly. I would like to know if it is still possible to use JWT Token to authenticate into the WebUI.I am not using NPM in production settings or publicly exposed, but I am constantly experimenting with it for learning purposes.
@GyimPet commented on GitHub (Nov 7, 2025):
Does this work under v2.13.1? Would you describe the steps in detail? Or is there a URL where this is described? Thanks in advance for your help!
@moutasem1989 commented on GitHub (Nov 8, 2025):
Yes this worked under v2.13.1. Steps for Both Authentik and NPX are described in the issue above.
@lastsamurai26 commented on GitHub (Nov 10, 2025):
Can you provide more detailed instructions if necessary?
Does this mean that npm.domain.de redirects directly to authentik and after logging in, you are logged into NPM?
@moutasem1989 commented on GitHub (Nov 10, 2025):
NPX credentials are stored in Authentik Attributes. When going to
npm.domain.dei am redirected to Authentik login page. After logging in, i am then redirected to NPM main dashboard. Because a fresh JWT token is fetched by Authentik and only after authentication is passed as header tonpm.domain.de, NPM thinks a login session is still valid.This means login once into Authentik allows me to login to all apps that use it.
@jc21 commented on GitHub (Nov 11, 2025):
The title of this says "after v2.13.1" - are you having problems using the
/api/tokensendpoint in 2.13.2?I ask because I've made no changes to the API - especially this endpoint - in 2.13
@moutasem1989 commented on GitHub (Nov 11, 2025):
Apologies for any misunderstanding.
In the new web UI i am still able to fetch a token using Authentik and pass it into
Authorizationheader after loging into Authentik. API endpoints did not change.In the new web UI is even when a valid token is passed in
Authorizationheader, i am no longer redirect to NPM dashboard. Logging in using JWT token inAuthorizationheader is not working after v2.13.1.My question was:
With the new frontend, is it still possible somehow to login into NPM dashboard using a JWT Token?
@xsustek commented on GitHub (Nov 11, 2025):
I’ve encountered the same problem.
In my setup, I previously worked around the missing OIDC support (PR #2630) by using an external authentication proxy in front of Nginx Proxy Manager. This setup worked fine up until version v2.13.1, but it stopped working after upgrading beyond that.
@xsustek commented on GitHub (Nov 11, 2025):
I believe the root cause of this issue might be related to how the authentication state is determined in the frontend.
In Router.tsx, the authenticated variable depends on the token value stored in localStorage. This token is set and read through AuthStore.ts and the AuthContext.
However, in setups where authentication is handled via an auth proxy, the token is not persisted in the browser’s localStorage — it’s attached dynamically to each proxied request instead. As a result, the frontend incorrectly assumes the user is unauthenticated even though the backend authenticates every request.