How to use JWT tokens with WCF and WIF?

后端 未结 1 811
星月不相逢
星月不相逢 2021-01-02 10:28

General notes

We\'re using IdentityServer3 and have been very happy with it so far.
We\'ve gotten to secure MVC and ASP.NET Web API applications very easily wi

相关标签:
1条回答
  • 2021-01-02 11:16

    I didn't get to solve this problem but Dominick Baier, one of the developers of IdentityServer, found a workaround.
    He thinks the exception comes from a bug in WCF or an incompatibility between WCF and the JwtSecurityTokenHandler. Since he considers WCF done, he doesn't expect someone to take a look at it.

    His solution is to wrap the JWT token in a SAML token. Then, by subclassing SamlSecurityTokenHandler, get it back and validate it against an instance of JwtSecurityTokenHandler.

    Here are the links:

    • Dominick's blog post
    • Samples repo on GitHub where he put the code
    • Specific commit on GitHub

    Everybody have fun, now :-)

    0 讨论(0)
提交回复
热议问题