Hello
I'm not sure to understand how to request a JWT token :
-Do we need to call the endpoints user/login before call /jwt/token ?
- So what we need to set after user/login, the cookie ?

Why is not possible to send directly credential in basic auth parameter on /jwt/token ? as mentionned here https://dev.acquia.com/blog/decoupled-drupal-authentication-json-web-tokens

As a logged-in user, or when you issue a GET request against /jwt/token with credentials of a user with the appropriate permissions, you will receive a token like that seen below, with which we can issue authenticated requests to Drupal.

so it should be ?

Do you discorourage to install this module https://www.drupal.org/project/getjwtonlogin ? ( this module provide directly the jwt token on user/login )

Comments

Musa.thomas created an issue. See original summary.

musa.thomas’s picture

Issue summary: View changes
musa.thomas’s picture

Issue summary: View changes
adamtyoung’s picture

I also have the same question. How does one simply get the JWT token using a JS library?

pwolanin’s picture

You can use that linked module, or participate in this issue which suggests pulling that functionality into the main jwt module:
#2957273: Get the token bearer with the JWT module after log in rest method

pwolanin’s picture

Status: Active » Closed (duplicate)