> For the complete documentation index, see [llms.txt](https://docs.denvrdata.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.denvrdata.com/docs/api-reference/authentication.md).

# Authentication

## POST /api/TokenAuth/Authenticate

> Authenticates the user's credentials and, upon successful verification, issues an access token that can be used to authorize subsequent requests made to the API

```json
{"openapi":"3.0.4","info":{"title":"DenvrCloud API","version":"v1"},"tags":[{"name":"TokenAuth"}],"paths":{"/api/TokenAuth/Authenticate":{"post":{"tags":["TokenAuth"],"summary":"Authenticates the user's credentials and, upon successful verification, issues an access token that can be used to authorize subsequent requests made to the API","operationId":"ApiTokenauthAuthenticatePost","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/AuthenticateResultModel"}},"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResultModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResultModel"}}}}}}}},"components":{"schemas":{"AuthenticateModel":{"required":["password","userNameOrEmailAddress"],"type":"object","properties":{"userNameOrEmailAddress":{"maxLength":256,"minLength":1,"type":"string"},"password":{"maxLength":128,"minLength":1,"type":"string"},"twoFactorVerificationCode":{"type":"string","nullable":true},"rememberClient":{"type":"boolean"},"twoFactorRememberClientToken":{"type":"string","nullable":true},"singleSignIn":{"type":"boolean","nullable":true},"returnUrl":{"type":"string","nullable":true},"captchaResponse":{"type":"string","nullable":true}},"additionalProperties":false},"AuthenticateResultModel":{"type":"object","properties":{"accessToken":{"type":"string","nullable":true},"encryptedAccessToken":{"type":"string","nullable":true},"expireInSeconds":{"type":"integer","format":"int32"},"shouldResetPassword":{"type":"boolean"},"passwordResetCode":{"type":"string","nullable":true},"userId":{"type":"integer","format":"int64"},"requiresTwoFactorVerification":{"type":"boolean"},"twoFactorAuthProviders":{"type":"array","items":{"type":"string"},"nullable":true},"twoFactorRememberClientToken":{"type":"string","nullable":true},"returnUrl":{"type":"string","nullable":true},"refreshToken":{"type":"string","nullable":true},"refreshTokenExpireInSeconds":{"type":"integer","format":"int32"},"c":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/TokenAuth/RefreshToken

> This endpoint allows for the renewal of the current access token, extending its validity period

```json
{"openapi":"3.0.4","info":{"title":"DenvrCloud API","version":"v1"},"tags":[{"name":"TokenAuth"}],"paths":{"/api/TokenAuth/RefreshToken":{"post":{"tags":["TokenAuth"],"summary":"This endpoint allows for the renewal of the current access token, extending its validity period","operationId":"ApiTokenauthRefreshtokenPost","parameters":[{"name":"refreshToken","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RefreshTokenResult"}},"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenResult"}},"text/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenResult"}}}}}}}},"components":{"schemas":{"RefreshTokenResult":{"type":"object","properties":{"accessToken":{"type":"string","nullable":true},"encryptedAccessToken":{"type":"string","nullable":true},"expireInSeconds":{"type":"integer","format":"int32"}},"additionalProperties":false}}}}
```

## GET /api/TokenAuth/LogOut

> Securely log out a user and invalidate the associated access token, effectively terminating the current session

```json
{"openapi":"3.0.4","info":{"title":"DenvrCloud API","version":"v1"},"tags":[{"name":"TokenAuth"}],"paths":{"/api/TokenAuth/LogOut":{"get":{"tags":["TokenAuth"],"summary":"Securely log out a user and invalidate the associated access token, effectively terminating the current session","operationId":"ApiTokenauthLogoutGet","responses":{"200":{"description":"OK"}}}}}}
```
