WSO2 APIM 3.1.0中的JWT

问题描述

我正在尝试探索WSO2 APIM 3.1.0的JWT功能,该功能将特定的属性(如最终用户/订户和应用程序详细信息)从WSO2 API网关传递到后端。我想知道在哪里可以找到默认的JWT生成器jar或类:“ org.wso2.carbon.apimgt.keymgt.token.JWTGenerator”。我检查了 / repository / components下的dropins文件夹,但没有找到。

默认的JWT生成器类发送详细信息,如下所示。我想知道,我们是否可以自定义发送用户/订户角色以及以下详细信息。需要有关此功能的建议。

{
  "http://wso2.org/claims/applicationtier": "Unlimited","http://wso2.org/claims/version": "1.0.0","http://wso2.org/claims/keytype": "PRODUCTION","iss": "wso2.org/products/am","http://wso2.org/claims/applicationname": "DefaultApplication","keytype": "PRODUCTION","http://wso2.org/claims/enduser": "john@carbon.super","http://wso2.org/claims/enduserTenantId": "-1234","http://wso2.org/claims/subscriber": "john","http://wso2.org/claims/tier": "Unlimited","scope": "order_pizza","exp": "1597753868867","http://wso2.org/claims/applicationid": "4","http://wso2.org/claims/usertype": "Application_User","consumerKey": "e5syg4saM5hAxDZkUYA1gy2hyy0a","http://wso2.org/claims/apicontext": "/pizzashack/1.0.0"
}

解决方法

您可以在https://apim.docs.wso2.com/en/latest/learn/api-gateway/passing-end-user-attributes-to-the-backend/passing-enduser-attributes-to-the-backend-using-jwt/#passing-enduser-attributes-to-the-backend-using-jwt中找到有关自定义JWT并将最终用户属性传递给使用JWT的后端的信息。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...