ASP.Net Core - IdentityServer4 client credentials authorization not workingLogout IdentityServer4 from .NET Core logs me back inMigrating web api authentication from .NET Core 1.1 to 2.0Identity Server4 Introspection Endpoint authentication with client credentialsIdentityServer4 & Asp.net Core Identity SignalR with bearer tokenCan OpenID Connect in IdentityServer4 Request Tokens from Client rather than generate internally?Microsoft.AspNetCore.Hosting.Internal.WebHost and log4net.LogicalThreadContext.Properties[“requestid”]Identity Server 4+.NET Core 2.0 + IdentityHow can I add AspNetIdentity to my API with IdentityServer4Web API returning UTF-16ASP.NET Core app slow to respond to requests after idle

"which" command doesn't work / path of Safari?

Is it possible to rebuild the bike frame (to make it lighter) by welding aluminum tubes

Why can't I see bouncing of a switch on an oscilloscope?

If I cast Expeditious Retreat, can I Dash as a bonus action on the same turn?

What are these boxed doors outside store fronts in New York?

Mathematical cryptic clues

Shell script not opening as desktop application

Do VLANs within a subnet need to have their own subnet for router on a stick?

Why are electrically insulating heatsinks so rare? Is it just cost?

Do any Labour MPs support no-deal?

Service Entrance Breakers Rain Shield

Is it possible to do 50 km distance without any previous training?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

Approximately how much travel time was saved by the opening of the Suez Canal in 1869?

Is the month field really deprecated?

How old can references or sources in a thesis be?

How can I make my BBEG immortal short of making them a Lich or Vampire?

Which models of the Boeing 737 are still in production?

In Japanese, what’s the difference between “Tonari ni” (となりに) and “Tsugi” (つぎ)? When would you use one over the other?

Dragon forelimb placement

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

Is it legal for company to use my work email to pretend I still work there?

same font throughout bibliography



ASP.Net Core - IdentityServer4 client credentials authorization not working


Logout IdentityServer4 from .NET Core logs me back inMigrating web api authentication from .NET Core 1.1 to 2.0Identity Server4 Introspection Endpoint authentication with client credentialsIdentityServer4 & Asp.net Core Identity SignalR with bearer tokenCan OpenID Connect in IdentityServer4 Request Tokens from Client rather than generate internally?Microsoft.AspNetCore.Hosting.Internal.WebHost and log4net.LogicalThreadContext.Properties[“requestid”]Identity Server 4+.NET Core 2.0 + IdentityHow can I add AspNetIdentity to my API with IdentityServer4Web API returning UTF-16ASP.NET Core app slow to respond to requests after idle






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am trying to create an admin client for IdentityServer4 (see full code at the time of posting here: https://github.com/TheMagnificent11/identity-server-admin/tree/0.0.1).



I've set-up my ID server using the standard steps outlined here: http://docs.identityserver.io/en/latest/quickstarts/7_entity_framework.html. The only difference is that I've moved the data access layer into a separate.Net Standard library.



I've created a second website that is to use client credentials. The client is configured on startup of the ID Server site (when running in debug configuration). Here is the code:



public static void InitializeDatabase(
this IApplicationBuilder app,
string adminApiName,
string clientId,
string clientSecret)

#if DEBUG
using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())

var appContext = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
appContext.Database.Migrate();

var grantContext = serviceScope.ServiceProvider.GetRequiredService<PersistedGrantDbContext>();
grantContext.Database.Migrate();

var configContext = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
configContext.Database.Migrate();

SeedAdminClient(adminApiName, clientId, clientSecret, configContext);

#endif


private static void SeedAdminClient(string adminApiName, string clientId, string clientSecret, ConfigurationDbContext configContext)

if (!configContext.IdentityResources.Any())

foreach (var resource in DefaultData.IdentityResources)

configContext.IdentityResources.Add(resource.ToEntity());



if (!configContext.ApiResources.Any())

var apiResource = new ApiResource(adminApiName, "Identity Server Admin");
configContext.ApiResources.Add(apiResource.ToEntity());


if (!configContext.Clients.Any())

var adminClient = new Client

ClientName = "Identity Server Admin",
ClientId = clientId,
ClientSecrets =

new Secret(clientSecret.Sha256())
,
AllowedScopes =

adminApiName
,
AllowedGrantTypes = GrantTypes.ClientCredentials,
Claims =

new Claim(AdminClientClaims.ManageUsersType, AdminClientClaims.ManageUsersValue)

;

configContext.Clients.Add(adminClient.ToEntity());


configContext.SaveChanges();



I can obtain a token using the client credentials. However, using the token to call the client API unexpectedly receives a 404 (the Postman collection for the requests is available here: https://github.com/TheMagnificent11/identity-server-admin/blob/0.0.1/postman_collection.json).



This is the API output from the client API:



info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 POST https://localhost:4001/users application/json 151
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Route matched with action = "Post", controller = "Users". Executing action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)
info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
Authorization failed.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'.
info: Microsoft.AspNetCore.Mvc.ChallengeResult[1]
Executing ChallengeResult with authentication schemes ().
info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[12]
AuthenticationScheme: Identity.Application was challenged.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin) in 69.589ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 284.0746ms 302
info: Microsoft.AspNetCore.Server.Kestrel[32]
Connection id "0HLL47CTA76NM", Request id "0HLL47CTA76NM:00000001": the application completed without reading the entire request body.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET https://localhost:4001/Account/Login?ReturnUrl=%2Fusers

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 25.5762ms 404


Does anyone know what I'm doing wrong?










share|improve this question






























    1















    I am trying to create an admin client for IdentityServer4 (see full code at the time of posting here: https://github.com/TheMagnificent11/identity-server-admin/tree/0.0.1).



    I've set-up my ID server using the standard steps outlined here: http://docs.identityserver.io/en/latest/quickstarts/7_entity_framework.html. The only difference is that I've moved the data access layer into a separate.Net Standard library.



    I've created a second website that is to use client credentials. The client is configured on startup of the ID Server site (when running in debug configuration). Here is the code:



    public static void InitializeDatabase(
    this IApplicationBuilder app,
    string adminApiName,
    string clientId,
    string clientSecret)

    #if DEBUG
    using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())

    var appContext = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
    appContext.Database.Migrate();

    var grantContext = serviceScope.ServiceProvider.GetRequiredService<PersistedGrantDbContext>();
    grantContext.Database.Migrate();

    var configContext = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
    configContext.Database.Migrate();

    SeedAdminClient(adminApiName, clientId, clientSecret, configContext);

    #endif


    private static void SeedAdminClient(string adminApiName, string clientId, string clientSecret, ConfigurationDbContext configContext)

    if (!configContext.IdentityResources.Any())

    foreach (var resource in DefaultData.IdentityResources)

    configContext.IdentityResources.Add(resource.ToEntity());



    if (!configContext.ApiResources.Any())

    var apiResource = new ApiResource(adminApiName, "Identity Server Admin");
    configContext.ApiResources.Add(apiResource.ToEntity());


    if (!configContext.Clients.Any())

    var adminClient = new Client

    ClientName = "Identity Server Admin",
    ClientId = clientId,
    ClientSecrets =

    new Secret(clientSecret.Sha256())
    ,
    AllowedScopes =

    adminApiName
    ,
    AllowedGrantTypes = GrantTypes.ClientCredentials,
    Claims =

    new Claim(AdminClientClaims.ManageUsersType, AdminClientClaims.ManageUsersValue)

    ;

    configContext.Clients.Add(adminClient.ToEntity());


    configContext.SaveChanges();



    I can obtain a token using the client credentials. However, using the token to call the client API unexpectedly receives a 404 (the Postman collection for the requests is available here: https://github.com/TheMagnificent11/identity-server-admin/blob/0.0.1/postman_collection.json).



    This is the API output from the client API:



    info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
    Request starting HTTP/1.1 POST https://localhost:4001/users application/json 151
    info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
    Executing endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
    info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
    Route matched with action = "Post", controller = "Users". Executing action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)
    info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
    Authorization failed.
    info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
    Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'.
    info: Microsoft.AspNetCore.Mvc.ChallengeResult[1]
    Executing ChallengeResult with authentication schemes ().
    info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[12]
    AuthenticationScheme: Identity.Application was challenged.
    info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
    Executed action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin) in 69.589ms
    info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
    Executed endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
    info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
    Request finished in 284.0746ms 302
    info: Microsoft.AspNetCore.Server.Kestrel[32]
    Connection id "0HLL47CTA76NM", Request id "0HLL47CTA76NM:00000001": the application completed without reading the entire request body.
    info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
    Request starting HTTP/1.1 GET https://localhost:4001/Account/Login?ReturnUrl=%2Fusers

    info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
    Request finished in 25.5762ms 404


    Does anyone know what I'm doing wrong?










    share|improve this question


























      1












      1








      1








      I am trying to create an admin client for IdentityServer4 (see full code at the time of posting here: https://github.com/TheMagnificent11/identity-server-admin/tree/0.0.1).



      I've set-up my ID server using the standard steps outlined here: http://docs.identityserver.io/en/latest/quickstarts/7_entity_framework.html. The only difference is that I've moved the data access layer into a separate.Net Standard library.



      I've created a second website that is to use client credentials. The client is configured on startup of the ID Server site (when running in debug configuration). Here is the code:



      public static void InitializeDatabase(
      this IApplicationBuilder app,
      string adminApiName,
      string clientId,
      string clientSecret)

      #if DEBUG
      using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())

      var appContext = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
      appContext.Database.Migrate();

      var grantContext = serviceScope.ServiceProvider.GetRequiredService<PersistedGrantDbContext>();
      grantContext.Database.Migrate();

      var configContext = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
      configContext.Database.Migrate();

      SeedAdminClient(adminApiName, clientId, clientSecret, configContext);

      #endif


      private static void SeedAdminClient(string adminApiName, string clientId, string clientSecret, ConfigurationDbContext configContext)

      if (!configContext.IdentityResources.Any())

      foreach (var resource in DefaultData.IdentityResources)

      configContext.IdentityResources.Add(resource.ToEntity());



      if (!configContext.ApiResources.Any())

      var apiResource = new ApiResource(adminApiName, "Identity Server Admin");
      configContext.ApiResources.Add(apiResource.ToEntity());


      if (!configContext.Clients.Any())

      var adminClient = new Client

      ClientName = "Identity Server Admin",
      ClientId = clientId,
      ClientSecrets =

      new Secret(clientSecret.Sha256())
      ,
      AllowedScopes =

      adminApiName
      ,
      AllowedGrantTypes = GrantTypes.ClientCredentials,
      Claims =

      new Claim(AdminClientClaims.ManageUsersType, AdminClientClaims.ManageUsersValue)

      ;

      configContext.Clients.Add(adminClient.ToEntity());


      configContext.SaveChanges();



      I can obtain a token using the client credentials. However, using the token to call the client API unexpectedly receives a 404 (the Postman collection for the requests is available here: https://github.com/TheMagnificent11/identity-server-admin/blob/0.0.1/postman_collection.json).



      This is the API output from the client API:



      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 POST https://localhost:4001/users application/json 151
      info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
      info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Route matched with action = "Post", controller = "Users". Executing action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)
      info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
      Authorization failed.
      info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
      Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'.
      info: Microsoft.AspNetCore.Mvc.ChallengeResult[1]
      Executing ChallengeResult with authentication schemes ().
      info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[12]
      AuthenticationScheme: Identity.Application was challenged.
      info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin) in 69.589ms
      info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 284.0746ms 302
      info: Microsoft.AspNetCore.Server.Kestrel[32]
      Connection id "0HLL47CTA76NM", Request id "0HLL47CTA76NM:00000001": the application completed without reading the entire request body.
      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET https://localhost:4001/Account/Login?ReturnUrl=%2Fusers

      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 25.5762ms 404


      Does anyone know what I'm doing wrong?










      share|improve this question
















      I am trying to create an admin client for IdentityServer4 (see full code at the time of posting here: https://github.com/TheMagnificent11/identity-server-admin/tree/0.0.1).



      I've set-up my ID server using the standard steps outlined here: http://docs.identityserver.io/en/latest/quickstarts/7_entity_framework.html. The only difference is that I've moved the data access layer into a separate.Net Standard library.



      I've created a second website that is to use client credentials. The client is configured on startup of the ID Server site (when running in debug configuration). Here is the code:



      public static void InitializeDatabase(
      this IApplicationBuilder app,
      string adminApiName,
      string clientId,
      string clientSecret)

      #if DEBUG
      using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())

      var appContext = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
      appContext.Database.Migrate();

      var grantContext = serviceScope.ServiceProvider.GetRequiredService<PersistedGrantDbContext>();
      grantContext.Database.Migrate();

      var configContext = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
      configContext.Database.Migrate();

      SeedAdminClient(adminApiName, clientId, clientSecret, configContext);

      #endif


      private static void SeedAdminClient(string adminApiName, string clientId, string clientSecret, ConfigurationDbContext configContext)

      if (!configContext.IdentityResources.Any())

      foreach (var resource in DefaultData.IdentityResources)

      configContext.IdentityResources.Add(resource.ToEntity());



      if (!configContext.ApiResources.Any())

      var apiResource = new ApiResource(adminApiName, "Identity Server Admin");
      configContext.ApiResources.Add(apiResource.ToEntity());


      if (!configContext.Clients.Any())

      var adminClient = new Client

      ClientName = "Identity Server Admin",
      ClientId = clientId,
      ClientSecrets =

      new Secret(clientSecret.Sha256())
      ,
      AllowedScopes =

      adminApiName
      ,
      AllowedGrantTypes = GrantTypes.ClientCredentials,
      Claims =

      new Claim(AdminClientClaims.ManageUsersType, AdminClientClaims.ManageUsersValue)

      ;

      configContext.Clients.Add(adminClient.ToEntity());


      configContext.SaveChanges();



      I can obtain a token using the client credentials. However, using the token to call the client API unexpectedly receives a 404 (the Postman collection for the requests is available here: https://github.com/TheMagnificent11/identity-server-admin/blob/0.0.1/postman_collection.json).



      This is the API output from the client API:



      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 POST https://localhost:4001/users application/json 151
      info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
      info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
      Route matched with action = "Post", controller = "Users". Executing action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)
      info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
      Authorization failed.
      info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
      Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'.
      info: Microsoft.AspNetCore.Mvc.ChallengeResult[1]
      Executing ChallengeResult with authentication schemes ().
      info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[12]
      AuthenticationScheme: Identity.Application was challenged.
      info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
      Executed action IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin) in 69.589ms
      info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'IdentityServer.Controllers.Users.UsersController.Post (IdentityServer.Admin)'
      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 284.0746ms 302
      info: Microsoft.AspNetCore.Server.Kestrel[32]
      Connection id "0HLL47CTA76NM", Request id "0HLL47CTA76NM:00000001": the application completed without reading the entire request body.
      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.1 GET https://localhost:4001/Account/Login?ReturnUrl=%2Fusers

      info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 25.5762ms 404


      Does anyone know what I'm doing wrong?







      c# asp.net-core identityserver4






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 9 at 5:17









      ArunPratap

      1,49831128




      1,49831128










      asked Mar 9 at 3:14









      TheMagnificent11TheMagnificent11

      63011034




      63011034






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Looks very similar to this issue: https://github.com/IdentityServer/IdentityServer4/issues/2406



          I pulled it down and tried this:



          services.AddAuthentication(options =>

          options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
          options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
          )
          .AddJwtBearer(options =>
          {
          // etc..



          Which got me a 403 rather than a 404






          share|improve this answer






























            0














            If you are receiving a 404 response, make sure that you are using the correct GET/POST/PUT request. Using GET method on a route that allows POST request only will result in 404 as well, even if the route URL is correct.






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55073644%2fasp-net-core-identityserver4-client-credentials-authorization-not-working%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Looks very similar to this issue: https://github.com/IdentityServer/IdentityServer4/issues/2406



              I pulled it down and tried this:



              services.AddAuthentication(options =>

              options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
              options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
              )
              .AddJwtBearer(options =>
              {
              // etc..



              Which got me a 403 rather than a 404






              share|improve this answer



























                1














                Looks very similar to this issue: https://github.com/IdentityServer/IdentityServer4/issues/2406



                I pulled it down and tried this:



                services.AddAuthentication(options =>

                options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
                )
                .AddJwtBearer(options =>
                {
                // etc..



                Which got me a 403 rather than a 404






                share|improve this answer

























                  1












                  1








                  1







                  Looks very similar to this issue: https://github.com/IdentityServer/IdentityServer4/issues/2406



                  I pulled it down and tried this:



                  services.AddAuthentication(options =>

                  options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                  options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
                  )
                  .AddJwtBearer(options =>
                  {
                  // etc..



                  Which got me a 403 rather than a 404






                  share|improve this answer













                  Looks very similar to this issue: https://github.com/IdentityServer/IdentityServer4/issues/2406



                  I pulled it down and tried this:



                  services.AddAuthentication(options =>

                  options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                  options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
                  )
                  .AddJwtBearer(options =>
                  {
                  // etc..



                  Which got me a 403 rather than a 404







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 9 at 6:57









                  emilolemilol

                  15113




                  15113























                      0














                      If you are receiving a 404 response, make sure that you are using the correct GET/POST/PUT request. Using GET method on a route that allows POST request only will result in 404 as well, even if the route URL is correct.






                      share|improve this answer



























                        0














                        If you are receiving a 404 response, make sure that you are using the correct GET/POST/PUT request. Using GET method on a route that allows POST request only will result in 404 as well, even if the route URL is correct.






                        share|improve this answer

























                          0












                          0








                          0







                          If you are receiving a 404 response, make sure that you are using the correct GET/POST/PUT request. Using GET method on a route that allows POST request only will result in 404 as well, even if the route URL is correct.






                          share|improve this answer













                          If you are receiving a 404 response, make sure that you are using the correct GET/POST/PUT request. Using GET method on a route that allows POST request only will result in 404 as well, even if the route URL is correct.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 9 at 5:14









                          Bishal SharmaBishal Sharma

                          2115




                          2115



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55073644%2fasp-net-core-identityserver4-client-credentials-authorization-not-working%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

                              Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                              List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229