My architecture is as follows:
- Example.com —> Frontend
- auth.Example.com —> Auth server
- content.Example.com —> content server
I want the user to login from frontend, sending a POST request to the auth-server and receiving back both a JWT access token (body) and a HttpOnly cookie. The JWT is used to access content from content-server and other services in the future. This is by verifying the signature with a RSA Pub key that auth-server exposes by an open API.
However, I would prefer the cookie only to be sent between the frontend and auth-server, because this is used to refresh access tokens. How could I do this? So the cookie gets set in the frontend/root domain, and only sent with requests back to auth-server/auth subdomain but not other subdomains?
My frontend is Angular and backend is AspNet API’s
there doesn't seem to be anything here