# ASP.NET Core MVC calling api

**URL:** <https://community.auth0.com/t/asp-net-core-mvc-calling-api/7638>\
**Category:** Get Help\
**Tags:** mvc, aspnet-mvc, api, aspnet-core, aspnet\
**Created:** [July 24, 2017, 6:59pm UTC](https://community.auth0.com/t/asp-net-core-mvc-calling-api/7638 "2017-07-24T18:59:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matteolocher](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matteolocher/32/4244_2.png) [@matteolocher](https://community.auth0.com/u/matteolocher)\
**Post date:** [July 24, 2017, 6:59pm UTC](https://community.auth0.com/t/asp-net-core-mvc-calling-api/7638/1 "2017-07-24T18:59:18Z")

</div>

I have a microservice architecture with a [ASP.NET](http://ASP.NET) Core MVC application as a frontend. All the microservices are also implemented as [ASP.NET](http://ASP.NET) Core services (Rest Services). I created a Client in my dashboard and a API for each Microservice. I authorized the client for all the API’s. I am able to login to my application and save the tokens. The access\_toke I get is really short, so not really a bearer token. If I then try to access the API i get a 401 Unautherized.

Which step am I missing? Do I need to implement another call to get an access\_token?

* * *

**Update**

I just saw this in the quickstart

```
OnRedirectToIdentityProvider = context =>
            {
                context.ProtocolMessage.SetParameter("audience", "http://my-api");
                return Task.FromResult(0);
            }

```

But I have more than one API. How can I add multiple audience?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [August 1, 2017, 8:13pm UTC](https://community.auth0.com/t/asp-net-core-mvc-calling-api/7638/2 "2017-08-01T20:13:59Z")

</div>

Given you addressed the initial question in your update I’ll provide some additional information about the follow-up situation regarding multiple audiences.

* * *

You can only pass a single audience value per request so your scenario either requires multiple requests or revising your configuration and representing your micro-services as a single audience.

For reference information related to this topic see:

> **[Configure Logical API for Multiple APIs](https://auth0.com/docs/get-started/apis/set-logical-api)**
>
> Learn how to use a single logical API in Auth0 to represent and control access to multiple APIs.

---

<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:55am UTC](https://community.auth0.com/t/asp-net-core-mvc-calling-api/7638/3 "2018-03-02T05:55:34Z")

</div>


