Quantcast
Channel: JWT.io - Auth0 Community
Viewing all articles
Browse latest Browse all 151

Angular and .NET 6 integrated

$
0
0

I’m wring an client server application with Angular and .NET 6 to implement Autherization and Autherization with Auth0. Here I’m following Authorization Code Flow These are the steps that I have followed

  1. Created Single page Application with Angular and added Auth0 login.
  2. I logged in and fetched the access token from “getAccessTokenSilently()” method.
    when I checked with jwt.io, it says Invalid Signature.
  3. Then I tried with idTokenClaims$ like this
this.auth.idTokenClaims$.subscribe(idToken => {
      console.log('Id Token: ', idToken);
      this.accessToken = idToken?.__raw;
    });
  1. Then no issue from jwt.io. But .Net back end with Autorize Attribute. My Program.cs is like this.
builder.Services.AddAuthentication(options =>
{
    options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
    options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
}).AddJwtBearer(options =>
{
    options.Authority = "https://dev-fi4bsupwmm2ptx7c.us.auth0.com/";
    options.Audience = "https://localhost:7181/";
});

Error message: Bearer error=“invalid_token”

  1. There is no any place to set Audience in my single page application in Auth0 side.

What can be the problem? How can I solve this?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 151

Trending Articles