【发布时间】:2019-08-28 19:14:14
【问题描述】:
我正在写一个基于此的 Accesstoken Builder msf4j example。我对角色等进行了一些过滤。我正在使用 wso2is 5.8 我尝试访问为服务提供者设置的 AccessTokenValidityPeriod。 在我的服务提供商设置中,我增加了“用户访问令牌到期时间”、“应用程序访问令牌到期时间”和“ID 令牌到期时间”。
我可以从 identity.xml 文件中访问令牌生命周期的值,但我想查找此服务提供者的具体设置。 我的代码是这样的
private long getLifetimeInMillis(OAuthAuthzReqMessageContext reqMessageContext, OAuthTokenReqMessageContext ctx) {
long lifetimeInMillis = -1;
if (reqMessageContext != null) {
log.debug("Get lifetime from OAuthAuthzReqMessageContext property");
lifetimeInMillis = reqMessageContext.getAccessTokenValidityPeriod();
/* always returns 0
... */
但这总是返回 0。 我已经调试了 OAuthAuthzReqMessageContext 类,但只有构造函数被称为而不是设置器 setAccessTokenValidityPeriod。 我的 pom.xml 包含:
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.application.authentication.framework</artifactId>
<version>5.12.387</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId>
<version>6.0.168</version>
<scope>provided</scope>
</dependency>
【问题讨论】:
-
您能否添加更多有关您提到的 msf4j 示例以及您要实现的用例的信息?
-
我添加了一些信息。希望对您有所帮助。
标签: wso2is