FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. manlio.marchica
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    manlio.marchica

    @manlio.marchica

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    manlio.marchica Unfollow Follow

    Latest posts made by manlio.marchica

    • RE: Claim not present in .Net

      I have the exact same problem. I have a Net6 Web Api project with swagger client configured. I have no claims

      I have AddJwtBearer with this settings

      services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
      .AddJwtBearer(options =>
      {
      options.Authority = fusionAuthAuthority;
      options.Audience = fusionAuthAudience;
      options.RequireHttpsMetadata = false; // DEV only!!
      });

      and swagger client configured this way

      services.AddSwaggerGen(c =>
      {
      c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
      {
      Type = SecuritySchemeType.OAuth2,
      Flows = new OpenApiOAuthFlows
      {
      AuthorizationCode = new OpenApiOAuthFlow
      {
      AuthorizationUrl = new Uri($"{fusionAuthAuthority}oauth2/authorize?audience={fusionAuthAudience}", UriKind.Absolute),
      TokenUrl = new Uri($"{fusionAuthAuthority}oauth2/token", UriKind.Absolute),
      Scopes = new Dictionary<string, string>() { }

               }
           }
       });
      
       c.AddSecurityRequirement(new OpenApiSecurityRequirement
       {
           {
               new OpenApiSecurityScheme
               {
                   Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "oauth2" }
               },
               Array.Empty<string>()
           }
       });
      
       c.ExampleFilters();
      
       c.DocumentFilter<OrderTagsDocumentFilter>();
      

      });

      Any updates on this issue or hints ?

      Thanks
      Manlio

      posted in Q&A
      M
      manlio.marchica