我已经提出问题Refresh token revoke,它在1-5分钟后工作。 但它仅适用于内置策略(用户流)而不适用于自定义策略。
我从内置策略获取了refresh_token A,从自定义策略获得了refresh_token B.
在同一租户中为同一用户接收两个令牌。
执行revoke(Graph API)后,当我尝试使用refresh_token A获取新访问权限并刷新令牌时,它会失败。但是当我尝试使用refresh_token B(通过自定义策略接收)时,它仍然有效。能得到新的代币。
在撤销电话后我给了15分钟的时间间隔。
请帮我解决这个问题。
The Configure the resource owner password credentials flow in Azure Active Directory B2C using a custom policy article描述了必须实现的自定义元素,以管理刷新令牌并测试已经发布的令牌尚未失效。
你必须:
默认情况下,时钟偏差设置为0,但您可以使用AssertRefreshTokenIssuedLaterThanValidFromDate声明转换的TreatAsEqualIfWithinMillseconds参数更改此值:
<ClaimsTransformation Id="AssertRefreshTokenIssuedLaterThanValidFromDate" TransformationMethod="AssertDateTimeIsGreaterThan">
<InputClaims>
<InputClaim ClaimTypeReferenceId="refreshTokenIssuedOnDateTime" TransformationClaimType="leftOperand" />
<InputClaim ClaimTypeReferenceId="refreshTokensValidFromDateTime" TransformationClaimType="rightOperand" />
</InputClaims>
<InputParameters>
<InputParameter Id="AssertIfEqualTo" DataType="boolean" Value="false" />
<InputParameter Id="AssertIfRightOperandIsNotPresent" DataType="boolean" Value="true" />
<!-- Set the clock skew to 5 minutes (300000 milliseconds). -->
<InputParameter Id="TreatAsEqualIfWithinMillseconds" DataType="int" Value="300000" />
</InputParameters>
</ClaimsTransformation>