Authtentication
JWT is used as technology for storing your keys.
General
Currenty the token can only be recieved if you use a standalone account.
Get a token
Create a GraphQL mutation query. Take the "login" mutation and make sure you fetch the token + the refresh token.
The result should look like this:
Take the token and the refresh token and store them in a secure way. Make sure you do not save them in local storage (for web application).
The difference between both keys is just the lifetime and the purpose. While you always need to use the token to recieve data from our api the refresh token is only used to get a new token. This is important to unterstand because the lifetime of the first token is really short (5 min).
Get a refreshed token
The output should look like this:
Use the token
The token can be passed to the backend by atttaching it as a header variable:
If the token is valid -> you will recieve the data. If the token is unvalid due to lifetime issues or because you do not have the permission -> an error will be thrown.