# Latest Angular with a .net 5 back end api

**URL:** <https://community.auth0.com/t/latest-angular-with-a-net-5-back-end-api/65218>\
**Category:** Get Help\
**Tags:** jwt, api, aspnet-core, angular\
**Created:** [June 28, 2021, 8:32pm UTC](https://community.auth0.com/t/latest-angular-with-a-net-5-back-end-api/65218 "2021-06-28T20:32:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradsharp54](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bradsharp54/32/30262_2.png) [@bradsharp54](https://community.auth0.com/u/bradsharp54)\
**Post date:** [June 28, 2021, 8:32pm UTC](https://community.auth0.com/t/latest-angular-with-a-net-5-back-end-api/65218/1 "2021-06-28T20:32:09Z")

</div>

I’ve been searching form posts and reading guides but nothing seems to work and there maybe 100’s of ways to do it, but… non of them seem right.

I have a simple setup. I have a single page app running in the latest angular. I also have a .net 5 rest back end.

Right now, a user can login to my angular application and auth.user$ has data and seems to be working. I think configured the AuthModule like this: (client id and domain redacted)

import { AuthHttpInterceptor, AuthModule } from ‘@auth0/auth0-angular’

AuthModule.forRoot({  
domain: ‘redacted’,  
clientId: ‘redacted’,  
scope: ‘read:api’,  
httpInterceptor: {  
allowedList: [  
‘\*’  
]}  
providers: [  
{  
provide: HTTP\_INTERCEPTORS,  
useClass: AuthHttpInterceptor,  
multi: true  
},

I don’t think the jwt is getting to the into the header of my api call.  
The response I get back from my API is this Bearer error=“invalid\_token”  
and the token, when I check, is not a JWT.

I’m assuming my api is setup correctly. (it probably isn’t) but if I can’t get a proper JWT to the api, I’ll never know. If I could create a JWT manually and use postman that would help for that section too.

So first question, how do I get a jwt instead of what ever is being passed now?

---

<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:** [June 28, 2021, 9:16pm UTC](https://community.auth0.com/t/latest-angular-with-a-net-5-back-end-api/65218/3 "2021-06-28T21:16:01Z")

</div>

Hi @bradsharp54,

Welcome to the Community!

You token is likely not a JWT because you are not passing your API as the audience in the auth request.

Here is a FAQ that explains it:

[https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028](https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028)

Here is our angular example that shows how to include an audience (this should be the identifier of your API that you have registered in the Auth0 dashboard). I would recommend looking over this document as is explains it in detail.

> **[Page Not Found](https://auth0.com/docs/quickstart/spa/angular/02-calling-an-api)**

---

<div class="post-metadata">

**Author:** ![bradsharp54](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bradsharp54/32/30262_2.png) [@bradsharp54](https://community.auth0.com/u/bradsharp54)\
**Post date:** [June 29, 2021, 6:25pm UTC](https://community.auth0.com/t/latest-angular-with-a-net-5-back-end-api/65218/4 "2021-06-29T18:25:45Z")

</div>

I’m not sure how I missed that but thanks for pointing something so simple out! I have it all working now and it really didn’t take me more than a day to setup.

Thanks again

Brad

---

<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:** [June 29, 2021, 7:41pm UTC](https://community.auth0.com/t/latest-angular-with-a-net-5-back-end-api/65218/5 "2021-06-29T19:41:25Z")

</div>

Awesome! Glad you found a solution!

---

<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:** [July 14, 2021, 7:41pm UTC](https://community.auth0.com/t/latest-angular-with-a-net-5-back-end-api/65218/6 "2021-07-14T19:41:48Z")

</div>

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