简体   繁体   English

更改 Azure AD B2C 访问令牌生命周期不起作用

[英]Changing Azure AD B2C Access Token lifetime doesn't work

I went to my Azure B2C → User flows (policies) → A flow of type "Sign up and sign in V2" → Properties → Token Lifetime.我去了我的 Azure B2C → 用户流(策略) → “注册并登录 V2”类型的流 → 属性 → 令牌生命周期。

There I changed the "Access & ID token lifetimes (minutes)" from 60 to 15. Then I saved.在那里,我将“访问和 ID 令牌生命周期(分钟)”从 60 更改为 15。然后我保存了。 I emptied the cache and refreshed the page to make sure that the value was really modified.我清空了缓存并刷新了页面以确保该值确实被修改了。

Today, more than 24 hours later, all my access tokens still have a lifetime of 60 minutes.今天,24 多小时后,我所有的访问令牌仍然有 60 分钟的生命周期。 I don't get it.我不明白。 I got the access token directly from a brand new authorization code.我直接从一个全新的授权码中获得了访问令牌。

Should I wait longer?我应该等待更长的时间吗? Is it a bug in Azure?它是 Azure 中的错误吗? Or did I do something wrong?还是我做错了什么?

I didn't reproduce your issue on my side.我没有在我这边重现您的问题。 There is no delay for this change to take effect.此更改不会延迟生效。 Make sure you are using the same application(clientId) to retrieve the access token.确保您使用相同的应用程序(clientId)来检索访问令牌。

Here are my test steps and results for your reference.下面是我的测试步骤和结果,供大家参考。

1.Set the token lifetime to 60 minutes. 1.将令牌生命周期设置为 60 分钟。

在此处输入图像描述

Get access token by using auth code flow.使用身份验证代码流获取访问令牌。

Get auth code.获取授权码。

https://tonyb2ctest.b2clogin.com/tonyb2ctest.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1_testsignupin
&client_id=c3a6429c-01XXX-ae02-1579b3f3fa9c
&response_type=code
&redirect_uri=https://windowXXXsbowman.azurewebsites.net/.auth/login/aad/callback
&response_mode=query
&scope=https://tonyb2ctest.onmicrosoft.com/api/user_impersonation
&state=12345

Get access token获取访问令牌

https://tonyb2ctest.b2clogin.com/tonyb2ctest.onmicrosoft.com/oauth2/v2.0/token?p=B2C_1_testsignupin

在此处输入图像描述

2.Set the token lifetime to 15 minutes. 2.将令牌生命周期设置为 15 分钟。

在此处输入图像描述

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM