Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

26 Comments

  1. super awesome article.

    question.
    could you please share your experience or knowledge about how to get user roles from token? or anyway
    because I need role base access to API endpoints.
    any example or help, please.

  2. Great article, Thank you.

    But, what makes me sad is accept the idea that IdentityServer4 it’s going to become a paid solution. Someone can thought “but the price is accessible”, it’s depends on what is you currency. for exemple here in Brazil the final value is 5.6x o valor described on their websites, it’s to empensive to us.

    https://duendesoftware.com/products/identityserver

  3. Hi! great article!

    I have a question for you, what about the user authentication (with user and pass)? How could be implemented the client and user authentication together?

  4. Good article!!

    Just a question, how we can use identity server to authenticate users too? Because you are using the [Authorize] tag for the API client but what happens if I want to secure that endpoint from the API consumer and also authenticate my API as a valid consumer as you described in this article.

    Thanks!

  5. I am a little new to MVC. I Followed all the way through and found that the Weather view never presented because the Weather Action in the Home controller never got called. In fact it looks like an error occurred on the WebApi page because of a 401. I added a tab on the main page and had it call the Weather Action in the Home controller and it worked. It also worked if I use postman and first get a bearer token and then make the call. I looked at your code but can’t see where it would ever get called. Can you think of anything I am missing.

  6. Hey Mukesh thanks for all these interesting articles ur blog is awesome

    have one doubt how to enable lockout for max failed attempts and in identity server 4 , i use identity server for two clients one for API and excel
    Following is the configurations done
    services.AddIdentityServer()
    .AddDeveloperSigningCredential()
    .AddResourceStore()
    .AddProfileService()
    .AddCorsPolicyService()
    .AddExtensionGrantValidator()
    .AddConfigurationStore(options =>
    {
    options.ConfigureDbContext = builder =>
    builder.UseSqlServer(Configuration.GetConnectionString(“IdentityConnection”),
    sql => sql.MigrationsAssembly(migrationsAssembly));
    });

  7. Hi Mukesh,

    I truly enjoy your articles on .Net core.

    I have simple query on IdentityServer4. Will this work with ASP.NET Core 5 project also?

    Regards

    1. Hi, Thanks.
      Yes, all of my articles are very compatible with .NET 5 and beyond as well. The only difference that can come is the package versions. But that should be handled automatically.
      Regards

  8. Thank you .. It is characterized by clarity in terms of step by step, another important thing that shows how these things relate to each other to play the role

  9. Hi Mukesh, I need your help on some customization. I wanted to connect with my existing database (flat table with user details) instead of TestUser (in-memory). How can I do that?

  10. i am using identity server in a different microservice and my api’s in different one i want that when i stop the identity server after login i should get an error it should not wait till the access token expires can u suggest me a solution

  11. Thanks for sharing this article.

    Can you come up with how to authenticate user with username and password along with their individual roles and claims from webApi Client. How do you map users to client for authentication and authorization for identity server that host authentication for many clients
    Response to this will be highy appreciated