gothinkster / spring-boot-realworld-example-app

Example Spring codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld API spec.
MIT License
1.32k stars 682 forks source link

401 error on login #5

Closed masithedeveloper closed 6 years ago

masithedeveloper commented 6 years ago

I get a 401 error code when logging in, how do I use the JWT secret key provided in application.properties file?

aisensiy commented 6 years ago

How do you get the jwt token? I think this should works with the official frontend application.

darioseidl commented 6 years ago

I was wondering the same at first. I got it running like this:

Voila, you get the user with the JWT in the body!

aisensiy commented 6 years ago

@darioseidl so you are using the official frontend to access /users/login or from the backend api?

darioseidl commented 6 years ago

I haven't tried any frontend yet. I was just running the backend and using the Postman collection from https://github.com/gothinkster/realworld/tree/master/api

aisensiy commented 6 years ago

Done with https://github.com/gothinkster/spring-boot-realworld-example-app/pull/6.