# How to obtain a JWT token by calling the Login end-point

**URL:** <https://hub.mender.io/t/how-to-obtain-a-jwt-token-by-calling-the-login-end-point/5064>\
**Category:** General Discussions\
**Tags:** management-api\
**Created:** [June 28, 2022, 9:14am UTC](https://hub.mender.io/t/how-to-obtain-a-jwt-token-by-calling-the-login-end-point/5064 "2022-06-28T09:14:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jason](https://hub.mender.io/u/jason)\
**Post date:** [June 28, 2022, 9:14am UTC](https://hub.mender.io/t/how-to-obtain-a-jwt-token-by-calling-the-login-end-point/5064/1 "2022-06-28T09:14:01Z")

</div>

Hello,  
I am trying to evaluate functionality of management api with my trial hosted mender account.  
My first step is to generate personal access token from here: [Mender](https://hosted.mender.io/ui/#/settings/my-profile)  
And then use the following command to request a JWT token and got a error message:

curl -X POST [https://hosted.mender.io/api/management/v1/useradm/auth/login](https://hosted.mender.io/api/management/v1/useradm/auth/login)   
-H ‘Content-Type: application/json’   
-H ‘Accept: application/jwt’   
-H ‘Authorization: Basic eyJhbGciOiJ…’  
{“error”:“invalid or missing auth header”,“request\_id”:“d64f60d1-5f2c-499b-a52e-41e4518f89dc”}%

From the instructions here : [Mender API docs](https://docs.mender.io/api/?shell#management-api-user-administration-and-authentication-login)  
The api needs to accept user credentials via standard Basic Auth. Would you pleaes explain more about how to finish the standard Basic Auth? Thank your.

Best Regards,  
Jason

---

<div class="post-metadata">

**Author:** ![Shaked](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/shaked/32/1815_2.png) [@Shaked](https://hub.mender.io/u/Shaked)\
**Post date:** [January 17, 2023, 11:58am UTC](https://hub.mender.io/t/how-to-obtain-a-jwt-token-by-calling-the-login-end-point/5064/2 "2023-01-17T11:58:29Z")

</div>

Hi @jason did you figure this one out?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [January 18, 2023, 3:14pm UTC](https://hub.mender.io/t/how-to-obtain-a-jwt-token-by-calling-the-login-end-point/5064/3 "2023-01-18T15:14:19Z")

</div>

Hi @Shaked,

The procedure for obtaining the JWT is described in a more verbose way [here](https://docs.mender.io/api/#management-api-user-administration-and-authentication-login). When trying to follow it, what are the problems that you see?

Greetz,  
Josef
