Boas Enkler
Boas Enkler

Reputation: 12557

IdentityServer Tutorial , token has Invalid Signature

I created a test application with the identity server.

It is very simple. it has some hard coded InMemory Users,Clients and SCopes and uses the idsrv3test.pfx certificated from the samples for signing

var factory = new IdentityServerServiceFactory();
factory
    .UseInMemoryUsers(MemoryUsers.All())
    .UseInMemoryClients(MemoryUsers.GetClients())
    .UseInMemoryScopes(MemoryUsers.GetScopes());

var cert = new X509Certificate2(@"..\certs\idsrv3test.pfx", "idsrv3test");

var options = new IdentityServerOptions()
{
    Factory = factory,
    EnableWelcomePage = true,
    SigningCertificate = cert,
    RequireSsl = false
};
 app.UseIdentityServer(options);

Now I get a a token via the connect/token endpoint. as grant type I use password.

This succeeds and I got a bearer token back.

now I wanted to validated the token contents on jwt.io . I shows me all the informations of all parts of the token. but at the end of the site it shows me "invalid signature"

enter image description here

Is this the result of a bug ? Or just a result that I use this test certificate?

Upvotes: 3

Views: 1489

Answers (1)

leastprivilege
leastprivilege

Reputation: 18492

Jwt.io cannot validate RS256 signatures. Only HS256.

Upvotes: 4

Related Questions