During each Http RequestHTTP request incoming from my Angular front-end I send encrypted pair of access & refresh token. On On the back end an-end ASP.NET Webweb APIs are used. The
The way I decrypt them currently is by creating 2 custom middlewares in one of the APIs (one after another): The first one decrypt the access token, modifies the http request header with the decrypted information and passes it to the next middleware. The second one checks if the (decrypted) access token is expired and depending on this - issues new access token, using the (decrypted) refresh token and again modifies the Http header with the new access token.
- The first one decrypt the access token, modifies the http request header with the decrypted information and passes it to the next middleware.
- The second one checks if the (decrypted) access token is expired and depending on this - issues new access token, using the (decrypted) refresh token and again modifies the HTTP header with the new access token.
Here is my implementation: 1st.
1st middleware:
I issue my tokens using Identity Server. My
My question is - is this methodology of mine according to good practicepractices or not? And can you recommend any better implementations?