# Using 3rd party REST API as custom identity provider

**URL:** <https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426>\
**Category:** Get Help\
**Created:** [April 2, 2020, 9:35pm UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426 "2020-04-02T21:35:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliank](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/juliank/32/20187_2.png) [@juliank](https://community.auth0.com/u/juliank)\
**Post date:** [April 2, 2020, 9:35pm UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426/1 "2020-04-02T21:35:24Z")

</div>

We’re developing a pretty straight-forward web application (Angular SPA client, .NET Core Web API backend) which will interact (both from the client and from the API) with a 3rd party API (3p-API, for short, in this post). Auth against the 3p-API is done by passing username/passwords to a simple REST endpoint, which returns an access token that is to be included with all other 3p-API requests.

Would it be possible to use this 3p-API as some kind of custom identity provider? I’ve been trying to look at the [Custom Social Connections extension](https://auth0.com/docs/extensions/custom-social-extensions), but this seems to require that the connection supports oauth, so that won’t do in this case?

The flow we picture ourselves is as follows:

1. User goes to our client and gets redirected for authentication to Auth0
2. User enters username/password (for 3p-API) at our Auth0 login screen
3. Auth0 uses entered username/password to make a request to 3p-API authentication endpoint, which if successful will return an access token
4. Auth0 redirects the user back to our client, with the 3p-API access token included as a claim (in a JWT?)
5. The client can then use the 3p-API access token to make requests against the 3p-API (or pass the access token on when making requests to our own API, which further can use the same access token to make direct requests to the 3p-API)

Is this scenario possible? I have tried searching the community for similar posts, but since I’m not too steady on all the terminology I might be searching for the wrong thing. If so, please just point me in the right direction!

---

<div class="post-metadata">

**Author:** ![juliank](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/juliank/32/20187_2.png) [@juliank](https://community.auth0.com/u/juliank)\
**Post date:** [April 5, 2020, 7:29am UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426/2 "2020-04-05T07:29:48Z")

</div>

Kindly pinging @dan.woda, since you offered your assistance [in another thread](http://community.auth0.com/t/is-the-spa-api-tutorial-outdated/40247/5).

---

<div class="post-metadata">

**Author:** ![yinzara](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yinzara/32/14830_2.png) [@yinzara](https://community.auth0.com/u/yinzara)\
**Post date:** [April 5, 2020, 7:14pm UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426/3 "2020-04-05T19:14:21Z")

</div>

If you want to pass the username and password from the Auth0 login form to an alternative identity provider you must use a custom database connection.

This requires an Enterprise level license agreement to use.

> **[Custom Database Connections](https://auth0.com/docs/authenticate/database-connections/custom-db)**
>
> Learn about authenticating users using your database as an identity provider.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 6, 2020, 7:04am UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426/4 "2020-04-06T07:04:25Z")

</div>

Thanks for sharing this knowledge on that front @yinzara!

---

<div class="post-metadata">

**Author:** ![juliank](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/juliank/32/20187_2.png) [@juliank](https://community.auth0.com/u/juliank)\
**Post date:** [April 6, 2020, 8:09am UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426/5 "2020-04-06T08:09:53Z")

</div>

Thank you @yinzara. I’ll be reading up on custom database connections then! Follow-up questions might appear 😉

---

<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:** [April 6, 2020, 4:52pm UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426/6 "2020-04-06T16:52:46Z")

</div>

Thanks for the help @yinzara!

---

<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:** [April 21, 2020, 4:52pm UTC](https://community.auth0.com/t/using-3rd-party-rest-api-as-custom-identity-provider/40426/7 "2020-04-21T16:52:46Z")

</div>

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