Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get and use authentication token for JHipster Microservice JWT

I created a JHipster microservice App with JWT authentication (I only have the "backend", no Angular GUI).

In my application-dev.yml, I have the following lines:

jhipster:
    security:
      authentication:
        jwt:
            secret: password
            # Token is valid 24 hours
            token-validity-in-seconds: 86400
            token-validity-in-seconds-for-remember-me: 2592000

How can I access the API with a client like "Restlet" (Google Chrome extension).

I read something about getting the token when accessing /api/authenticate but it didn't work (JHipster authentication using Postman and JWT)

Where can I retrieve the JWT Token and how to use it in subsequent requests?

like image 527
dfsg76 Avatar asked Jan 30 '23 22:01

dfsg76


1 Answers

You've chosen a microservices architecture: so now you need a registry and a gateway( read the doc).

You get a token by authenticating against the gateway then you use this token by passing it on each request with Authorization http header.

like image 194
Gaël Marziou Avatar answered Feb 02 '23 11:02

Gaël Marziou