Reputation: 1588
I wan to implement authentication endpoint for Angular Login page. I tried to implement this example.
But I have 2 questions which are not clear:
1. What is the endpoint to which I need to make a POST request with user and pass in order to get a token as response?
Looking at the tutorial diagram it should be /users/login but I don's see this endpoint implemented:
Upvotes: 0
Views: 121
Reputation: 6006
It is there under /users/signin
in User Controller. The method name is still login. The path /users
is mapped to the controller
and the /signin
is mapped to the method
Yes. You will have to provide some custom implementation
loadByUsername
method inside MyUserDetails
you can only pass username
as parameter.UserDetails
subclass which is then used by the JwtTokenProvider
getAuthentication()
method@Autowired MyUserDetails
in JwtTokenProvider class UserDetails
with all the needed data that is then used in JwtTokenProvider -> getAuthentication() method
Upvotes: 1