# How to add Auth0 authentication to a serverless API

**URL:** <https://discourse.sst.dev/t/how-to-add-auth0-authentication-to-a-serverless-api/2333>\
**Category:** Chapter Comments\
**Created:** [February 25, 2021, 3:56am UTC](https://discourse.sst.dev/t/how-to-add-auth0-authentication-to-a-serverless-api/2333 "2021-02-25T03:56:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [February 25, 2021, 3:56am UTC](https://discourse.sst.dev/t/how-to-add-auth0-authentication-to-a-serverless-api/2333/1 "2021-02-25T03:56:40Z")

</div>

Link to chapter — [https://serverless-stack.com/examples/how-to-add-auth0-authentication-to-a-serverless-api.html](https://serverless-stack.com/examples/how-to-add-auth0-authentication-to-a-serverless-api.html)

---

<div class="post-metadata">

**Author:** ![gregfenton](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/gregfenton/32/1470_2.png) [@gregfenton](https://discourse.sst.dev/u/gregfenton)\
**Post date:** [August 12, 2023, 11:02pm UTC](https://discourse.sst.dev/t/how-to-add-auth0-authentication-to-a-serverless-api/2333/2 "2023-08-12T23:02:51Z")

</div>

The example doesn’t give steps or doc pointers as to how to set the `AUTH0_DOMAIN` environment variable so that the Lambda can have access to it.

---

<div class="post-metadata">

**Author:** ![gregfenton](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/gregfenton/32/1470_2.png) [@gregfenton](https://discourse.sst.dev/u/gregfenton)\
**Post date:** [August 13, 2023, 11:48pm UTC](https://discourse.sst.dev/t/how-to-add-auth0-authentication-to-a-serverless-api/2333/3 "2023-08-13T23:48:17Z")

</div>

Added a PR showing adding the values to `.env`

---

<div class="post-metadata">

**Author:** ![gregfenton](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/gregfenton/32/1470_2.png) [@gregfenton](https://discourse.sst.dev/u/gregfenton)\
**Post date:** [August 13, 2023, 11:55pm UTC](https://discourse.sst.dev/t/how-to-add-auth0-authentication-to-a-serverless-api/2333/4 "2023-08-13T23:55:12Z")

</div>

This example would benefit from showing the Lambda function accessing the JWT information, and a link to details of what data is available via that object.
