# Need help with confirming a small project's architecture

**URL:** <https://community.auth0.com/t/need-help-with-confirming-a-small-projects-architecture/95971>\
**Category:** Get Help\
**Tags:** login-prompt-new-experience, login-experience\
**Created:** [December 8, 2022, 2:21am UTC](https://community.auth0.com/t/need-help-with-confirming-a-small-projects-architecture/95971 "2022-12-08T02:21:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iosifv](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/iosifv/32/41780_2.png) [@iosifv](https://community.auth0.com/u/iosifv)\
**Post date:** [December 8, 2022, 2:21am UTC](https://community.auth0.com/t/need-help-with-confirming-a-small-projects-architecture/95971/1 "2022-12-08T02:21:02Z")

</div>

I am creating a simple app for training purposes.  
This prints Google Directions information in the terminal in a complicated way 🙂

> **[GitHub - iosifv/cli-path: My first attempt at building a CLI tool](https://github.com/iosifv/cli-path)**
>
> My first attempt at building a CLI tool. Contribute to iosifv/cli-path development by creating an account on GitHub.

The idea is to query Google Directions API using an intermediary serverless Lambda function so that I don’t ask users to add their own Google API Token.

Flow:

1. **CLI App** calls **Lambda**
2. **Lambda** calls **Google API**
3. Response gets to **Lambda**
4. Response gets passed to **CLI App**
5. Information is displayed on the terminal

I want to create some limiting mechanisms for my Google calls so here’s where authentication is needed.  
What I did so far, is to follow the [Device Authorization Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-device-authorization-flow) within my **CLI-App** and I got an access\_token.  
Now what should I do? I am sending this token to Lambda in the authorization header, sure, but what do I do within the Serverless function?

- what endpoint should I use to validate this token through Auth0?
- how should I know who is calling? add a payload from the cli-app or can Auth0 provide that?
- Should I cache this token on the serverless side or just validate it with every call?
- What are some other good practices I should create?

Thank you for reading all of this and thanks for helping.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 9, 2022, 9:58pm UTC](https://community.auth0.com/t/need-help-with-confirming-a-small-projects-architecture/95971/3 "2022-12-09T21:58:25Z")

</div>

Hi @iosifv,

Welcome to the Auth0 Community!

From what I understand, you want to request Access Tokens specifically for you Lamba API, and be able to verify and inspect those tokens.

You will need to register your [Lambda as and API](https://auth0.com/docs/get-started/apis) in your Auth0 tenant. Once you do that, you can request access tokens specifically for your Lambda function by adding the API identifier of your Lambda as the _audience._

Those tokens should be returned as JWTs, which can be verified and inspected in your Lambda. AWS provides some features to help here, so you don’t have to do it manually in your Lambda. Check out this blog: [APIs](https://auth0.com/docs/get-started/apis)

Let me know if you have any questions.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 30, 2023, 9:39pm UTC](https://community.auth0.com/t/need-help-with-confirming-a-small-projects-architecture/95971/4 "2023-01-30T21:39:52Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
