0

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.

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

E.g. Normal token generation command:

curl -k -d "grant_type=client_credentials" -H "Authorization: Basic userToken, Content-Type: application/x-www-form-urlencoded" localhost: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 -d "grant_type=client_credentials" -d "validity_time=99999" -H "Authorization: Basic userToken, Content-Type: application/x-www-form-urlencoded" localhost:8243/token

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

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.

4

1 回答 1

1

开箱即用不支持此功能。您可以通过编写自定义 OAuth 授权类型来实现它。有关如何编写自定义 OAuth 授权类型的更多详细信息,请参阅 [1]。

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

于 2015-08-02T16:08:05.947 回答