增加 B2C 自定义策略中的刷新令牌生命周期
Increase refresh token lifetime in B2C custom policy
我能够为我的自定义 B2C 策略检索刷新令牌,但想将令牌生命周期增加到最大限制或将滑动 window 生命周期设置为无过期。
这可以通过基本策略的 Azure 门户 B2C 设置完成,但在自定义策略的门户中不可用。
如何在我的策略中配置它?
查看 this article。
在您的RP技术资料中具体添加以下内容。
<Item Key="token_lifetime_secs">3600</Item>
可以看起来像这样(从文档中复制)
<ClaimsProviders>
<ClaimsProvider>
<DisplayName>Token Issuer</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="JwtIssuer">
<Metadata>
<Item Key="token_lifetime_secs">3600</Item>
<Item Key="id_token_lifetime_secs">3600</Item>
<Item Key="refresh_token_lifetime_secs">1209600</Item>
<Item Key="rolling_refresh_token_lifetime_secs">7776000</Item>
<Item Key="IssuanceClaimPattern">AuthorityAndTenantGuid</Item>
<Item Key="AuthenticationContextReferenceClaimPattern">None</Item>
</Metadata>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
</ClaimsProviders>
Parakh 所说的是正确的,但请注意他链接到的 the page 上的横幅,上面写着关于 SPA 应用程序与 PKCE 的以下内容:
Note
Single-page applications using the authorization code flow with PKCE always have a refresh token lifetime of 24 hours while mobile apps, desktop apps, and web apps do not experience this limitation. Learn more about the security implications of refresh tokens in the browser.
这意味着这些应用可能不遵守以下设置:
refresh_token_lifetime_secs
rolling_refresh_token_lifetime_secs
allow_infinite_rolling_refresh_token
- 最后一个 从未 受到 SPA w/ PKCE 的尊重
我能够为我的自定义 B2C 策略检索刷新令牌,但想将令牌生命周期增加到最大限制或将滑动 window 生命周期设置为无过期。
这可以通过基本策略的 Azure 门户 B2C 设置完成,但在自定义策略的门户中不可用。
如何在我的策略中配置它?
查看 this article。
在您的RP技术资料中具体添加以下内容。
<Item Key="token_lifetime_secs">3600</Item>
可以看起来像这样(从文档中复制)
<ClaimsProviders>
<ClaimsProvider>
<DisplayName>Token Issuer</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="JwtIssuer">
<Metadata>
<Item Key="token_lifetime_secs">3600</Item>
<Item Key="id_token_lifetime_secs">3600</Item>
<Item Key="refresh_token_lifetime_secs">1209600</Item>
<Item Key="rolling_refresh_token_lifetime_secs">7776000</Item>
<Item Key="IssuanceClaimPattern">AuthorityAndTenantGuid</Item>
<Item Key="AuthenticationContextReferenceClaimPattern">None</Item>
</Metadata>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
</ClaimsProviders>
Parakh 所说的是正确的,但请注意他链接到的 the page 上的横幅,上面写着关于 SPA 应用程序与 PKCE 的以下内容:
Note
Single-page applications using the authorization code flow with PKCE always have a refresh token lifetime of 24 hours while mobile apps, desktop apps, and web apps do not experience this limitation. Learn more about the security implications of refresh tokens in the browser.
这意味着这些应用可能不遵守以下设置:
refresh_token_lifetime_secs
rolling_refresh_token_lifetime_secs
allow_infinite_rolling_refresh_token
- 最后一个 从未 受到 SPA w/ PKCE 的尊重