# Auth between Application and API

**URL:** <https://community.auth0.com/t/auth-between-application-and-api/129716>\
**Category:** Get Help\
**Tags:** platform-infrastructure, general-architecture-question\
**Created:** [March 14, 2024, 4:27pm UTC](https://community.auth0.com/t/auth-between-application-and-api/129716 "2024-03-14T16:27:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![quinten.de.clerck](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/quinten.de.clerck/32/53455_2.png) [@quinten.de.clerck](https://community.auth0.com/u/quinten.de.clerck)\
**Post date:** [March 14, 2024, 4:27pm UTC](https://community.auth0.com/t/auth-between-application-and-api/129716/1 "2024-03-14T16:27:55Z")

</div>

Hello,

Im working on a new application in c# .NET that will communicate with their own API also in .NET.  
But here im a bit confused with auth0 i can make an API in my dashboard that returns an JWT token and my application should also authenticate the user with password or a social provider. How can i secure my web API so only authenticated users can access my API through the Application?

thanks in advance,

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 14, 2024, 8:23pm UTC](https://community.auth0.com/t/auth-between-application-and-api/129716/3 "2024-03-14T20:23:50Z")

</div>

Hello @quinten.de.clerck !

Have you had chance to take a look at the samples [here](https://developer.auth0.com/resources/code-samples)? We do provide several .NET samples which could be helpful depending on your specific needs. It’s a great way to understand the relationship between authentication/authorization of a user and the use of an API in code.

> [@quinten.de.clerck](#):
>
> How can i secure my web API so only authenticated users can access my API through the Application?

At a high level users will authenticate/authorize against your app using [Universal Login](https://auth0.com/docs/authenticate/login/auth0-universal-login) (which can include social providers) - Once they have completed auth Auth0 will return ID and access tokens. The access token is typically only handled client side and serves to represent the authenticated user. On the other hand, the access token will be used against and validated by your API.

---

<div class="post-metadata">

**Author:** ![quinten.de.clerck](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/quinten.de.clerck/32/53455_2.png) [@quinten.de.clerck](https://community.auth0.com/u/quinten.de.clerck)\
**Post date:** [March 15, 2024, 9:21am UTC](https://community.auth0.com/t/auth-between-application-and-api/129716/4 "2024-03-15T09:21:16Z")

</div>

@ty.frith I followed this document [Register APIs](https://auth0.com/docs/get-started/auth0-overview/set-up-apis) and this is the part where i got confused. I have an C# Web API and i registered an API in auth0 dashboard but it is not my C# web API that returns a token to my application, right?

So my user should use universal login in the application and the application should contact the API created in the dashboard which returns a token i can than use to contact my own C# Web API?

thanks in advance,

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 16, 2024, 1:08am UTC](https://community.auth0.com/t/auth-between-application-and-api/129716/5 "2024-03-16T01:08:34Z")

</div>

Hey @quinten.de.clerck thanks for following up.

> [@quinten.de.clerck](#):
>
> So my user should use universal login in the application and the application should contact the API created in the dashboard which returns a token i can than use to contact my own C# Web API?

Your client side application is most likely what users will interact with and engage with universal login - During the login flow you’ll use the API identifier of the API you registered in Auth0 as the [audience](https://community.auth0.com/t/what-is-the-audience/71414) param. Once your client has a user’s access token, this is what will be used against and validated by your API.

---

<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 30, 2024, 1:08am UTC](https://community.auth0.com/t/auth-between-application-and-api/129716/6 "2024-03-30T01:08:55Z")

</div>

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