D
D
Denis Kuznetsov2022-02-04 14:42:16
JavaScript
Denis Kuznetsov, 2022-02-04 14:42:16

How to form and send a React Js Principal to a Spring Boot application?

Hello, the situation is as follows:
There is a Spring Boot app that is built in war
It has controllers that wait for some data (json object) and security information (Principal) as input
As far as I understand, the Principal, Session and the entire security context are initialized by spring under the hood themselves and allow themselves to be used
. There is also a React Js app that is responsible for the UI and passes the data entered by the user to the spring service, but in itself it does not have Principal
Question: is there an analogue of this class in React and how to initialize it for further transfer to the spring application?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2022-02-04
@Akela_wolf

The React app needs to send the data that Spring needs to construct the Principal. A common option is a JWT token. Or a session ID. Or something else, you need to look at the specifics of how Spring Security is configured in your application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question