All request to Tribe's GraphQL endpoint except for
tokens query should be authenticated.
If you want to authenticate as a guest or as a member using their email (or username) and password, the most common way is to use the
tokens query. Here is a sample query:
You should replace the
networkDomain value to your own community address. The result of the above query will be a guest access token as followed:
You should pass the provided
accessToken in all GraphQL requests in the header as followed:
With a guest access token you have a read only access to all resources available to non-logged in members.
To retrieve a user access token you should use the guest access token to send a request to
loginNetwork does not work without passing a guest access token in the header and will result in
Unauthorized error message.
The result of the above query will be a user access token as followed:
Similar to guest access tokens you will be able to use the user access token by passing it in the header as followed: