WSO2 API Manager(1.9.0) - 通过cURL设置过期日期/有效时间 [英] WSO2 API Manager (1.9.0) - Set Expire Date/Validity Time Via cURL

查看:501
本文介绍了WSO2 API Manager(1.9.0) - 通过cURL设置过期日期/有效时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过商店使用WSO2 AM时,可以设置有效时间,以便可以增加/减少访问令牌到期时间。

When using the WSO2 AM via the Store it is possible to set a Validity Time, so that the access token expire time can be increased/decreased.

在生成新令牌时可以通过cURL设置有效时间吗?

Is it possible to set the Validity Time via cURL when generating a new token?

Eg
正常的令牌生成命令:

E.g. Normal token generation command:

curl -k -dgrant_type = client_credentials-H授权:基本userToken,类型:application / x-www-form-urlencodedlocalhost:8243 / token

{scope: am_application_scope default,token_type:bearer,expires_in:1367,access_token:1234456677890}

设置有效时间的令牌生成命令:

Possible token generation command with setting validity time:

curl -k -dgrant_type = client_credentials-dvalidity_time = 99999-H :基本userToken,Content-Type:application / x-www-form-urlencodedlocalhost:8243 / token

{scope:am_application_scope default,token_type:bearer,expires_in:99999,access_token:1234456677890}

用于设置此命令的正确命令是什么?这是因为我希望API管理器的用户能够通过我们提供的Java API客户端设置到期日期。

What is the correct command to use for setting this? The reason for this, is because I would like the users of the API Manager be able to set the expire date via a Java API client that we offer.

推荐答案

这不是开箱即用的。您可以通过编写自定义OAuth授权类型来实现。有关如何撰写自定义OAuth授权类型的详情,请参阅[1]。

This is not supported out of the box. You can implement it by writing a custom OAuth Grant Type. Please refer [1] for more details on how to write a custom OAuth Grant Type.

[1] https://docs.wso2.com/display/IS500/Writing+a+Custom+OAuth+2.0+Grant +类型

这篇关于WSO2 API Manager(1.9.0) - 通过cURL设置过期日期/有效时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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