简体   繁体   English

获取触发WSO2 API管理器调用的应用程序的名称

[英]Get the name of the Application that triggers a call from WSO2 API Manager

Is it possible to get the name of the Application that triggered the API call on WSO2 API Manager and pass it on to the call as a header? 是否可以获取在WSO2 API Manager上触发了API调用的应用程序的名称,并将其作为标头传递给调用?

Any can help how to do this please. 任何可以帮助您做到这一点的人。

Yes, application name is part of the JWT token that you get with the calls. 是的,应用程序名称是您通过调用获得的JWT令牌的一部分。 Here's documentation . 这是文档

JWT tokens are enabled by default in WSO2 API Cloud (the public hosted service from WSO2). 默认情况下, WSO2 API CloudWSO2的公共托管服务)中启用了JWT令牌。 So if you are using it - everything just works. 因此,如果您正在使用它-一切正常。

If you are deploying API Manager yourself, you need to configure JWT yourself as explained here . 如果您自己部署API Manager,则需要按照此处的说明自行配置JWT。

One option would be to implement an custom handler. 一种选择是实现自定义处理程序。 See Writing Custom Handlers 请参阅编写自定义处理程序

APIMgtUsageHandler is one of the handlers in API manager which collects the application name (to collect usage data). APIMgtUsageHandler是API管理器中的处理程序之一,该处理程序收集应用程序名称(以收集使用情况数据)。 So you can refer it as a sample handler on how to get the application name. 因此,您可以将其作为如何获取应用程序名称的示例处理程序。 see APIMgtUsageHandler.java 参见APIMgtUsageHandler.java

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

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