How do i use the ''Auth-x-token" id provided by spring boot for my RestApi calls

1k Views Asked by At

I am using Spring-boot, and i want to make API calls since i am building a single page application. Spring boot provides a session id on every page header as "Auth-x-token" when a page is served (if you have configured Spring session in your app). I am confused now cause i want to send this ID back to the server so it can know the user in session. Please how can this be achieved.

1

There are 1 best solutions below

6
On

First, note that the X-Auth-Token is a custom/proprietary HTTP header. The way it works is - this contains the session id and so it can be used very similarly to how you'd use that.

Simply put, you'll send this header with your request so that you don't have to provide your credentials for that request. You can read more about it here.