M
M
MDAMDA2021-05-30 19:15:26
Java
MDAMDA, 2021-05-30 19:15:26

Spring Security authentication via Post method?

Good afternoon. I'm trying to develop an application using Spring Security. Subsequently, it is planned that an Android application will act as a client.
I made a registration and when I send a post request in postman it registers wonderfully. But when I do login. it links me to an html page with a login form. I added a custom page, added it in the configuration and loginProcessingUrl, POST request and I get60b3ba0917a9b463852721.jpeg

60b3b9928011c868425532.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-05-30
Hasanly @azerphoenix

Good afternoon.
If it is assumed that there will be authorization through an android or a js framework, then you need to develop a REST service.
In this case, a POST request from the client sends the username and password to the backend. There we generate jwt and return it to the client. Further, another endpoint will each time check jwt for correctness and issue the necessary data.
Here is a good example of jwt auth implementation - https://github.com/hantsy/spring-webmvc-jwt-sample

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question