This is used to detect the userId based on the authentication token and inject it inside the GraphQL's context. On top of that it offers a seamless integration with
Passport for easy integration with different auth providers
IGraphQLContext is properly extended by this package:
Benefit of over 500+ authentication strategies, by offering plug-in support for most popular library: passport
We define our methods of authentication through
Authenticator classes. Read through it as the comments will explain the behavior.
Note, if you are using
X-Framework, you can inject the AppRouter which generates urls for the app:
getToken() we create an actual token for authentication for the user. The problem is that when we pass that to the
ui microservice, the url can be sniffed, leading to a security whole in the system.
The solution is that once you arrive at that specific url call the mutation
reissueToken(token) which will return instead a newly freshly created token that you can store in
localStorage or where you prefer.