gpt4 book ai didi

WSO2 JWTGenerator 和 APIMgtGatewayJWTGeneratorImpl

转载 作者:行者123 更新时间:2023-12-02 01:28:18 26 4
gpt4 key购买 nike

有人向我解释一下 JWTGenerator 和 APIMgtGatewayJWTGeneratorImpl 类之间的区别吗?

我将wso2从2.6.0版本更新到4.1.0,只有这个JWTGenerator生成器类,但现在它不起作用。

引用:https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/api-gateway/passing-enduser-attributes-to-the-backend-via-api-gateway/#sample-jwt

最佳答案

在 WSO2 API Manager 的早期版本中,它具有不透明 token 支持。因此,如果您要迁移到最新的 APIM 版本并且仍然想使用不透明 token 而不是 JWT token ,则必须使用 JWTGenerator 类。如果你看一下这个类的包,它是org.wso2.carbon.apimgt.keymgt.token。因此 token 生成发生在 key 管理器(KM)侧。当 API 调用中使用不透明 token 时,网关会调用 key 管理器来验证不透明 token ,并生成后端 JWT。然后,网关从 KM 接收有效访问 token 的后端 JWT,并且 GW 将后端 JWT 发送到后端服务。请参阅 - https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/api-gateway/passing-enduser-attributes-to-the-backend-via-api-gateway/#customizing-the-jwt-generation-completely

如果您使用 JWT 访问 token 来访问 API,则应使用 APIMgtGatewayJWTGeneratorImpl。当访问 token 到达网关时,它会验证 token 本身并生成后端 JWT。所以就使用了这个类。请参阅 - https://apim.docs.wso2.com/en/latest/deploy-and-publish/deploy-on-gateway/api-gateway/passing-enduser-attributes-to-the-backend-via-api-gateway/#jwt-self-contained-access-tokens

关于WSO2 JWTGenerator 和 APIMgtGatewayJWTGeneratorImpl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73895779/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com