我的应用程序中有以下代码,比如 WebApp1:
app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = "IdentityServerPath",
RequiredScopes = new[] { "write", "role", "all_claims" },
ValidationMode = ValidationMode.Local,
});
Run Code Online (Sandbox Code Playgroud)
调用方/客户端应用程序将 JWT 令牌传递给 WebApp1。WebApp1 如何知道 JWT 令牌有效?WebApp1 需要知道 JWT 令牌的公钥吗?如果不是,WebApp1如何验证JWT的签名?请注意,我使用 ValidationMode 作为本地,因此 WebApp1 不会联系 IdentityServer 来验证 JWT 令牌。