WSO2 Api Manager-如何更改JWT的到期时间? [英] WSO2 Api Manager - How to change the expiration time of JWT?

查看:76
本文介绍了WSO2 Api Manager-如何更改JWT的到期时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改在WSO2 Api Manager中创建的JWT令牌的到期时间. 似乎默认时间是15分钟.

I want to change the expiration time of JWT token created in WSO2 Api Manager. It seems that the default time is 15 minutes.

{"typ":"JWT","alg":"none"}.
{
"iss": "wso2.org/products/am",
"exp": 1464255150998,
 ...
}

通过此链接- Wso2 Jira-APIMANAGER-3493 ,看来我们可以请使用API​​KeyManager下/repository/conf/api-manager.xml中的"SecurityContextTTL"属性来更改JWT的到期时间.

From this link - Wso2 Jira - APIMANAGER-3493 , it seems that we can use "SecurityContextTTL" property in /repository/conf/api-manager.xml under APIKeyManager to change the expiration time of the JWT.

但是我在api-manager.xml中找不到此设置(甚至没有注释掉的配置).我正在使用wso2am-1.9.1.

But I could not find this setting available in api-manager.xml (not even as a commented out configuration). I am using wso2am-1.9.1.

此属性是否已从配置中删除?如果是,那么我们如何更改JWT的到期时间?

Is this property removed from the configurations? If yes, then how can we change the expiration time of the JWT?

是否有任何有关此属性及其用法的文档?

Is there any documentation available mentioning about this property and its usage?

任何指针都值得赞赏.谢谢.

Any pointers are appreciated. Thanks.

推荐答案

在APIKeyValidator部分下,应按如下所述应用它,

It should be applied as follows, under APIKeyValidator section,

   <APIKeyValidator>
           <SecurityContextTTL>5</SecurityContextTTL>
   </APIKeyValidator>

但是根据您提到的Jira,似乎此版本中存在错误.

But as per the Jira you mentioned, it seems there is a bug in this version.

WSO2已在下一版本(2.0.0)中使用新属性修复了此问题,请参见[1].

WSO2 has fixed this in next version(2.0.0), using a new property, see [1].

[1] https://wso2.org/jira/browse/APIMANAGER-4575

这篇关于WSO2 Api Manager-如何更改JWT的到期时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆