Whenever I change something at server side which causes a restart or recompile I only get 401s containing this header:
WWW-Authenticate:Bearer error="invalid_token", error_description="The signature key was not found"
I have identity server and my api in the same project. In identity server 3 we had to configure a signing certificate. I did not see that in your examples, which felt quite strange.
What am I doing wrong? Or do i have to add the certificate? How?
you are probably using the AddDeveloperIdentityServer extension method.
This will set a temp. signing key which will recycle with every start. You can use the SetSigningCredential method to set an explicit one.
@leastprivilege Thank you.
As i dont need in memory stores anymore, I replaced AddDeveloperIdentityServer with AddIdentityServer and added a certificate. Works fine like this now:
/*
* Use powershell as administrator to create a new dev certificate:
* New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname some.testingdomain.internal
* Then export using mmc (include private key)
*/
var contentRootPath = _environment.ContentRootPath;
var cert = new X509Certificate2(Path.Combine(contentRootPath, "devcert.pfx"), "password");
services.AddIdentityServer()
.SetSigningCredential(cert)
.....
Is AddSigningCredential the new name for SetSigningCredential or are these different?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Is
AddSigningCredentialthe new name forSetSigningCredentialor are these different?