# Authentication flow using 1st party gateway and payments

**URL:** <https://community.auth0.com/t/authentication-flow-using-1st-party-gateway-and-payments/8664>\
**Category:** Get Help\
**Tags:** api-call, subscription, 3rd-party-api\
**Created:** [November 3, 2017, 4:32pm UTC](https://community.auth0.com/t/authentication-flow-using-1st-party-gateway-and-payments/8664 "2017-11-03T16:32:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![logistics](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@logistics](https://community.auth0.com/u/logistics)\
**Post date:** [November 3, 2017, 4:32pm UTC](https://community.auth0.com/t/authentication-flow-using-1st-party-gateway-and-payments/8664/1 "2017-11-03T16:32:28Z")

</div>

_ **Scenario** _

We are building an API that acts as a main API for all of our products.  
We want that API to manage Users and all of their Subscriptions for our other products.  
(All of our APIs are .Net based)

* * *

_ **Tools** _

- Authentication: _Auth0_
- Payment and Subscriptions: _Braintree Payments_

* * *

_ **Question** _

Is it good practice to, instead of the sub-product directly calling the Auth0 API, make the sub-products and clients call our Main API, and from the Main API first check the user subscription for the requested sub-product and then call Auth0 and generate a token which is then returned to the end-client, since then we can also make sure that the user has a valid subscription (ex they signed up for the subscription and their card isn’t declined)

* * *

_ **Example** _

![alt text][1]

---

<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:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/authentication-flow-using-1st-party-gateway-and-payments/8664/2 "2018-03-02T05:57:16Z")

</div>


