# ASERGO graphql Docs - [GraphQL schema](https://api.asergo.com/v1/schema) - [GraphiQL endpoint](https://api.asergo.com/v1/gr) - [GraphQL endpoint](https://api.asergo.com/v1/graphql) - [Asergo dashboard ](https://dashboard.asergo.com) - [Asergo demo dashboard ](https://demo-dashboard.asergo.com) # Authentication authentication can be done in 2 diffent ways depending on your needs: ## BasicHttpCredentials Include the HTTP header "Authorization: Basic " where is the Base64 encoding of ID and password joined by a single colon : ## API token Use a graphQL mutations to obtain a token and include the token in the query, or in a header, or the coockie returned ### Generate token with graphql mutation mutation CreateToken{ createToken(input:{ user:"MY_USERNAME", password:"MY_PASSWORD" oneTimePassword:"OPTIONAL_OTP_CODE" }){ token userId error expireAt otpRequired } } ### renew token with graphql mutation mutation RenewToken{ viewer{ renewToken{token expireAt error} }} ### include token in COOKIE when token is generated the token is stored in a cookie. include the cookie in your requests ### include the token in a HTTP header Include the HTTP header "Authorization: Bearer " where is the API token obtained in the CreateToken/RenewToken mutation. ### include the token in the query the 'viewer' type takes a token paremeret: - query: query{ viewer(token: "TOKEN"){ ...}} - mutation: mutation{ viewer(token:""){...}} - subscription: NOT supported. use one of the obove methods to provide the token