mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #3417] Add token support #2284
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#2284
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 @skyfore on GitHub (Dec 25, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3417
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
By adding token support, we are able to retrieve information, such as lists of websites, using tokens through API requests.
@tilalx commented on GitHub (Jan 10, 2024):
Hi,
couldn`t you not just request
returns
then you can get all websites for example via:
returns
@skyfore commented on GitHub (Jan 11, 2024):
@tilalx thanks very much, really helpful !
But this method relies on your account and password, which can sometimes be insecure.
@elchusco commented on GitHub (Mar 11, 2024):
Thanks @tilalx, couldn't find any relaterd information on how to process token retrieval. Is it documented somewhere that I missed ?
@gadget78 commented on GitHub (Mar 24, 2024):
once you have created a token, you dont need to use the user/pass anymore.
plus you can set/increase the timeframe the token expires from the default of a day ..
curl "http://192.168.1.10:81/api/tokens" -H "Content-Type: application/json; charset=UTF-8" --data-raw '{"identity":"email@address","secret":"place-password-here","expiresIn":"1y"}also for docs, ive been using this location, to work out what to do ..
https://github.com/NginxProxyManager/nginx-proxy-manager/tree/develop/backend/routes/api
@skyfore commented on GitHub (Mar 25, 2024):
Thank you, this is really helpful.
@TheEdgeFox commented on GitHub (Aug 27, 2024):
Is the "expiresIn" actively working for you? No matter what I've tried, I cannot get it to expire any later than 1 day.
@tilalx commented on GitHub (Aug 27, 2024):
Replace "expiresIn":"1y" with "expiry": "1y". When I do this, it returns the following response:
{ "token": "ey...", "expires": "2025-08-27T07:30:06.209Z" }@moutasem1989 commented on GitHub (Oct 22, 2024):
Hello @tilalx ! I came across your post trying to understand JWT Authentication.
Can NPM also automatically authenticate and fetch the Token to bypass the login screen ?
I have done this successfully for services that use Basic HTTP Authentication but not the ones that use JWT Authentication like NPM itself.
My purpose is to find a workaround and authenticate in to services with Authentik and bypass log in screen.
@rahulparekh commented on GitHub (Jan 22, 2025):
For anyone reading this as of today,
expiryhas to be passed in as a query param instead of request body. Like this:https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/backend/routes/tokens.js#L28
@Erreur32 commented on GitHub (Jan 30, 2025):
I have updated my script using http://localhost:81/api/tokens?expiry=10y, but the token still expires after one day. I also tried:
However, it still expires after one day. Has anyone else encountered this issue @rahulparekh ?
@rahulparekh commented on GitHub (Feb 13, 2025):
Try this:
https://github.com/NginxProxyManager/nginx-proxy-manager/discussions/3265#discussioncomment-12192178
@github-actions[bot] commented on GitHub (Sep 9, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍