# Accessing a secured API from a C# application

**URL:** <https://community.auth0.com/t/accessing-a-secured-api-from-a-c-application/41381>\
**Category:** Get Help\
**Created:** [April 20, 2020, 12:47am UTC](https://community.auth0.com/t/accessing-a-secured-api-from-a-c-application/41381 "2020-04-20T00:47:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![progdog](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/progdog/32/12848_2.png) [@progdog](https://community.auth0.com/u/progdog)\
**Post date:** [April 20, 2020, 12:47am UTC](https://community.auth0.com/t/accessing-a-secured-api-from-a-c-application/41381/1 "2020-04-20T00:47:01Z")

</div>

Hello,

My company is trying to use Auth0 to secure our software licensing API, and as part of this effort we would like to have our users authenticate with Auth0 from within our C# applications and then access a secured API endpoint. However, I have been unable to find any documentation on how to set the “audience” using the .NET Auth0.OidcClient. The API documentation tells me to refer to the Native application quickstart, but I couldn’t find any details there. Am I going about this the wrong way? Please help if you can.

Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![rev23dev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rev23dev/32/13118_2.png) [@rev23dev](https://community.auth0.com/u/rev23dev)\
**Post date:** [April 21, 2020, 8:38pm UTC](https://community.auth0.com/t/accessing-a-secured-api-from-a-c-application/41381/2 "2020-04-21T20:38:17Z")

</div>

Hi @progdog,

You need to pass the audience as a parameter in the LoginAsync call…

client.LoginAsync(new { audience = “blah” });

Hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![progdog](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/progdog/32/12848_2.png) [@progdog](https://community.auth0.com/u/progdog)\
**Post date:** [April 25, 2020, 8:50am UTC](https://community.auth0.com/t/accessing-a-secured-api-from-a-c-application/41381/3 "2020-04-25T08:50:41Z")

</div>

Thank you so much for the help!

---

<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:** [May 10, 2020, 9:02am UTC](https://community.auth0.com/t/accessing-a-secured-api-from-a-c-application/41381/4 "2020-05-10T09:02:05Z")

</div>

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