Base solution for your next web application
Open Closed

IdentityServer Changed Client Id and Client issue #4419


User avatar
0
joe704la created

I am getting ready to switch to using IdentityServer and I am having an issue. I changed the ClientId and ClientSecrets in the Hosts appsettings.json. I then went to test it by using the ConsoleApiClient. I also changed the ClientId and ClientSecrets to match whats in the config file. But it now gives me the error. "Invalid_client".

Does anyone have any ideas? Is there another place I need to change the ClientId and secret?

I for sure can't keep them the defaults that comes when we download the project.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You also need to change it here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/aspnet-core/test/MyCompanyName.AbpZeroTemplate.ConsoleApiClient/Program.cs">https://github.com/aspnetzero/aspnet-ze ... Program.cs</a>.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    joe704la created

    @ismcagdas, oh yeah sorry that is what I meant when I said I also changed the ClientId and ClientSecrets to match what's in the config file. I meant that I changed it in the <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/aspnet-core/test/MyCompanyName.AbpZeroTemplate.ConsoleApiClient/Program.cs">https://github.com/aspnetzero/aspnet-ze ... Program.cs</a>. But I am still getting the "Invalid_Client"

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    joe704la created

    I got the new client to work but I am having a different issue with the test project. When the method RunDemoAsync() runs and it tries to grab the GetUsersListAsync(accessToken) it throws a 500 error but doesn't give me any more details than that. I tried looking in the log for the error but nothing.

    One more question. What is the tempkey.rsa used for?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    alper created
    Support Team

    wrap GetUsersListAsync in a try-catch block to see the error. Beside if you get error in GetUsersListAsync action, it's better to see web logs. Because web api doesn't send exception details.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)