# How to set up a authorization code flow correctly?

**URL:** <https://community.auth0.com/t/how-to-set-up-a-authorization-code-flow-correctly/162642>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [December 14, 2024, 12:19pm UTC](https://community.auth0.com/t/how-to-set-up-a-authorization-code-flow-correctly/162642 "2024-12-14T12:19:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [December 16, 2024, 2:47pm UTC](https://community.auth0.com/t/how-to-set-up-a-authorization-code-flow-correctly/162642/3 "2024-12-16T14:47:11Z")

</div>

Hi @bryce.wayne.person

Thank you for posting your question,

Based on your description, you can create an API pointing to the backend; this way, when calling for an access token, you can pass your Backend API identifier as the audience, and your access token will be valid JWT. This way, you can set a shorter expiration date for the token.

Here’s a quickstart for Golang as API → [Auth0 Go API SDK Quickstarts: Add authorization to a Go API](https://auth0.com/docs/quickstart/backend/golang/interactive)

If you don’t want to follow that and continue to use the opaque access token, you are not supposed to validate them. Instead, they are validated on the Auth0 server when being passed in the request for the `/userinfo` endpoint.

I hope this answers your questions.  
Thanks  
Dawid

---

_[View the full topic](https://community.auth0.com/t/how-to-set-up-a-authorization-code-flow-correctly/162642)._
