繁体   English   中英

如何验证Line-api的ID令牌? (如何以与Java相同的方式使用jwt.net?)

[英]How to verify id token for Line-api? (how to use jwt.net in the same way as java?)

如何使用JWT.Net验证id_token? 这是java中的代码:

            JWT.require(
            Algorithm.HMAC256(channelSecret))
            .withIssuer("https://access.line.me")
            .withAudience(channelId)
            .withClaim("nonce", nonce)
            .build()
            .verify(id_token);

有关https://developers.line.me/en/docs/line-login/web/integrate-line-login/的详细信息
请参阅零件: Decoding and validating ID tokens

如何在C#.Net中实现相同的功能? 在nuget上有JWT.Net找不到类似的方法。

我发现了现在如何使用JWT.Net。

                decodedJson = new JwtBuilder()
                .WithSecret(secret)
                .WithAlgorithm(hmacsha256Algorithm)
                .MustVerifySignature()
                .Decode(idToken);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM