# The right way to call Auth0 APIs in a web app?

**URL:** <https://community.auth0.com/t/the-right-way-to-call-auth0-apis-in-a-web-app/50967>\
**Category:** Get Help\
**Tags:** architechture, api-gateway, auth0\
**Created:** [October 5, 2020, 7:51am UTC](https://community.auth0.com/t/the-right-way-to-call-auth0-apis-in-a-web-app/50967 "2020-10-05T07:51:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hirschtomer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hirschtomer/32/14833_2.png) [@hirschtomer](https://community.auth0.com/u/hirschtomer)\
**Post date:** [October 5, 2020, 7:51am UTC](https://community.auth0.com/t/the-right-way-to-call-auth0-apis-in-a-web-app/50967/1 "2020-10-05T07:51:21Z")

</div>

Hey,

I am planning to write an app that structured from:

- **SPA** - React app
- **BFF** - Backend for frontend (there is a chance that I will have another BFF for a react native consumer)
- **Gateway** - a single source of truth for my API’s
- Couple of **Micro-Services**

I am going to use implicit flow.

My question is where is the right place to call to the auth0 API?

---

<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:** [October 5, 2020, 10:06pm UTC](https://community.auth0.com/t/the-right-way-to-call-auth0-apis-in-a-web-app/50967/3 "2020-10-05T22:06:51Z")

</div>

Hi @hirschtomer,

Welcome to Auth0!

> [@hirschtomer](#):
>
> I am going to use implicit flow.

Why not use auth code + PKCE?

> [@hirschtomer](#):
>
> My question is where is the right place to call to the auth0 API?

Authenticate in your SPA (or native app), and request tokens for your APIs/backend.

---

<div class="post-metadata">

**Author:** ![hirschtomer](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hirschtomer/32/14833_2.png) [@hirschtomer](https://community.auth0.com/u/hirschtomer)\
**Post date:** [October 6, 2020, 10:19am UTC](https://community.auth0.com/t/the-right-way-to-call-auth0-apis-in-a-web-app/50967/4 "2020-10-06T10:19:40Z")

</div>

Hey Dan,

Thanks for replying after I read the documentation: [Which OAuth 2.0 Flow Should I Use?](https://auth0.com/docs/authorization/which-oauth-2-0-flow-should-i-use)

I think that I will go with your recommendations.

Thanks!

Regards,  
Tomer.

---

<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:** [October 6, 2020, 3:27pm UTC](https://community.auth0.com/t/the-right-way-to-call-auth0-apis-in-a-web-app/50967/5 "2020-10-06T15:27:05Z")

</div>

Let us 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:** [October 21, 2020, 3:27pm UTC](https://community.auth0.com/t/the-right-way-to-call-auth0-apis-in-a-web-app/50967/6 "2020-10-21T15:27:16Z")

</div>

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