View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0036095 | mantisbt | api rest | public | 2025-06-30 01:32 | 2025-07-20 03:52 |
Reporter | gthomas | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 2.27.1 | ||||
Summary | 0036095: Cannot create API token programmatically | ||||
Description | My use case is to transfer my CLI program from username:password to username:token. The REST api exposes /users/me/token to allow creating a new Token for token-based authentication, The SOAP api allows both password and token based authentication, BUT does not expose a CreateToken function. | ||||
Tags | No tags attached. | ||||
Two solutions I see: Which would be accepted as a PR? |
|
https://github.com/mantisbt/mantisbt/pull/2141 is solution b). |
|
@vboctor, the user is raising a valid point here, user needs a token to create a token with the How do you suggest addressing this ? |
|
I have been trying to avoid including username and password support in REST API and hoping that SOAP API becomes disabled by default and eventually removed. The reasons for avoiding passwords are:
What I don't understand is why the CLI can't be configured to use a token instead of a password. Similar to The scenario of using a token to create another token is mainly used for provisioning scenarios. Where an app can use an admin token and be able to create and dispense tokens for other users. It is also unclear to me if you use an API to create a token that is persisted, how often are you going to create such token? If we are ever to consider this scenario, I think we would be using non-persisted and expiring JWT tokens. But it would still not address the top concerns. I can understand that you may persist the created token on the client in a file, but if so, why not persist the token instead? |
|
I don't want username+password support in REST API, I want to use tokens. This functionality (create API token from SOAP) is needed to ease the transition from username+password auth to token-based auth: As this is just a one-time need (till my users move to token based auth), I can live with it (enable it in my instance for a while). |
|