- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
大家早上好,
我已在 Azure 中设置了应用服务,并通过 Azure AD B2C 添加了身份验证。到目前为止一切都很好。 1 小时后,当 token 过期时,我尝试刷新它,但随后收到一条错误消息,表明刷新 token 已被撤销。这里出了什么问题?我已经按照这篇文章中的说明设置了后端:登录时我传递了附加参数,如下所示:
user = await Manager.CurrentClient.LoginAsync(currentContext,MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory,new Dictionary<string, string>() { { "response_type", "code id_token" } });
这是我的刷新代码:
user = await Manager.CurrentClient.RefreshUserAsync();
这是我遇到的错误
{Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException: Refresh failed with a 403 Forbidden error. The refresh token was revoked or expired. ---> Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException: You do not have permission to view this directory or page. at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient+d__24.MoveNext () [0x001ec] in :0
我在这里遗漏了什么吗?谢谢
编辑3:这里是来自网络服务器的给定请求的应用程序日志:
2017-01-18T15:08:33 PID[6344] Verbose Received request: GET https://api.near.lu/.auth/refresh 2017-01-18T15:08:33 PID[6344] Verbose JWT validation succeeded. Subject: 'sid:453a1ad2710466bc9873240e888d8b91', Issuer: 'https://api.near.lu/'. 2017-01-18T15:08:33 PID[6344] Warning The refresh request issued by sid:453a1ad2710466bc9873240e888d8b91 (SID: ac22f7309036f0c07a54b1299b9601ef) failed because no refresh tokens were found in the token store. 2017-01-18T15:08:33 PID[6344] Information Sending response: 403.80 Forbidden 2017-01-18T15:08:34 PID[6344] Verbose Received request: GET https://api.near.lu/.auth/login/aad?response_type=code%20id_token 2017-01-18T15:08:34 PID[6344] Verbose Downloading OpenID configuration from https://login.microsoftonline.com/nearauth.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_Default 2017-01-18T15:08:36 PID[6344] Verbose Downloading OpenID issuer keys from https://login.microsoftonline.com/nearauth.onmicrosoft.com/discovery/v2.0/keys?p=b2c_1_default 2017-01-18T15:08:37 PID[6344] Information Redirecting: https://login.microsoftonline.com/nearauth.onmicrosoft.com/oauth2/v2.0/authorize?response_type=code+id_token&redirect_uri=https%3A%2F%2Fapi.near.lu%2F.auth%2Flogin%2Faad%2Fcallback&client_id=c4c15bfb-eac4-4cdc-861f-eb01594e19d2&scope=openid+profile+email&response_mode=form_post&state=redir%3D%26b2cPolicy%3D&p=b2c_1_default&nonce=9e243549b62f49878cc370048c6effa9_20170118151334 2017-01-18T15:08:39 PID[6344] Verbose Received request: POST https://api.near.lu/.auth/login/aad/callback 2017-01-18T15:08:39 PID[6344] Error An error of type 'unauthorized_client' occurred during the login process: 'AADB2C90057: The provided application is not configured to allow the OAuth Implicit flow. Correlation ID: 8336662f-8847-4f8b-bb37-6925a5d3e264 Timestamp: 2017-01-18 15:08:38Z ' 2017-01-18T15:08:39 PID[6344] Information Sending response: 401.73 Unauthorized
编辑4:这是成功登录的日志:
2017-01-18T19:10:14 PID[6344] Verbose Received request: GET https://api.near.lu/.auth/login/aad?response_type=code%20id_token 2017-01-18T19:10:14 PID[6344] Information Redirecting: https://login.microsoftonline.com/nearauth.onmicrosoft.com/oauth2/v2.0/authorize?response_type=code+id_token&redirect_uri=https%3A%2F%2Fapi.near.lu%2F.auth%2Flogin%2Faad%2Fcallback&client_id=c4c15bfb-eac4-4cdc-861f-eb01594e19d2&scope=openid+profile+email&response_mode=form_post&state=redir%3D%26b2cPolicy%3D&p=b2c_1_default&nonce=817be561f67343688001637fa7808690_20170118191514 2017-01-18T19:10:30 PID[6344] Verbose Received request: POST https://api.near.lu/.auth/login/aad/callback 2017-01-18T19:10:30 PID[6344] Verbose JWT validation succeeded. Subject: '1eaf9f41-1562-4ac9-9538-b893c9123087', Issuer: 'https://login.microsoftonline.com/07407dc1-946a-4afc-9186-84e6023ba814/v2.0/'. 2017-01-18T19:10:30 PID[6344] Verbose Calling into external HTTP endpoint POST https://login.microsoftonline.com/nearauth.onmicrosoft.com/oauth2/v2.0/token. 2017-01-18T19:10:32 PID[6344] Information Login completed for 'aget'. Provider: 'aad'. 2017-01-18T19:10:32 PID[6344] Verbose Writing 'AppServiceAuthSession' cookie for site 'api.near.lu'. Length: 792. 2017-01-18T19:10:32 PID[6344] Information Redirecting: https://api.near.lu/.auth/login/done#token=%7B%22authenticationToken%22%3A%22ey--REMOVED PART OF THE TOKEN--%22%2C%22user%22%3A%7B%22userId%22%3A%22sid%3Aed01ed7507f147976aa1704783267861%22%7D%7D 2017-01-18T19:10:33 PID[6344] Verbose Received request: GET https://api.near.lu/.auth/login/done 2017-01-18T19:10:33 PID[6344] Information Sending response: 200.0 OK
这是我登录后尝试立即刷新时收到的错误日志:
2017-01-23T10:55:06 PID[6344] Verbose Received request: POST https://api.near.lu/.auth/refresh 2017-01-23T10:55:06 PID[6344] Verbose JWT validation succeeded. Subject: 'sid:ed01ed7507f147976aa1704783267861', Issuer: 'https://api.near.lu/'. 2017-01-23T10:55:06 PID[6344] Warning The refresh request issued by sid:ed01ed7507f147976aa1704783267861 (SID: 9a6c2ee324a092937c5e2f953803e662) failed because no refresh tokens were found in the token store. 2017-01-23T10:55:06 PID[6344] Information Sending response: 403.80 Forbidden
这很奇怪,因为在上图中可以看到 token 存储已启用......
最佳答案
问题可能是您当前的应用服务身份验证/授权设置未配置为支持 token 刷新。确认这一点的一个简单方法是启用应用程序日志记录,并在刷新操作失败时查看应用程序日志流中的警告消息。有关应用程序日志记录的更多详细信息可以在此处找到:https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-enable-diagnostic-log
请参阅以下博客文章(我撰写),了解有关如何更新身份验证/授权设置以支持 token 刷新的更多信息:https://cgillum.tech/2016/08/10/app-service-auth-and-azure-ad-b2c-part-2/#refresh 。简而言之,您需要:
您的登录代码应如下所示:
user = await Manager.CurrentClient.LoginAsync(
currentContext,
MobileServiceAuthenticationProvider.WindowsAzureActiveDirectory,
new Dictionary<string, string>() { { "scope", "openid offline_access" } });
关于Azure AD B2C 刷新 token 已撤销 403,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40802785/
我目前正在使用 Oracle Database Express Edition 11g 处理一些 GRANT 选项。考虑以下小代码示例,其中一些用户向其他用户授予一些权限: -- User A GRA
我不明白这两个查询之间的区别, 1.修改用户用户名账户锁定;2.REVOKE CREATE SESSION FROM 用户名; 这些查询将如何影响用户? 如果我使用撤销 session ,那么可以进行
我正在尝试撤销以下 Google token API ("Content-type:application/x-www-form-urlencoded",请求类型 POST,https://accou
我不明白这两个查询之间的区别, 1.改变用户用户名账户锁;2.REVOKE CREATE SESSION FROM用户名; 这些查询将如何影响用户? 如果我使用 revoke session 那么可以
在服务器上使用 python 访问 firestore 管理员: import firebase_admin from firebase_admin import credentials, fires
MariaDB 中是否可以撤销用户的权限并同时撤销他授予的用户的权限?到目前为止我已经尝试过类似的事情 REVOKE SELECT ON mysql.sometable FROM 'user'@'%'
如果我使用普通用户帐户创建表: create table test (a text, b text, c text); 同一用户可以对表执行所有操作... john=# \z test
在 PostgreSQL 中,当 super 用户授予任何权限时(例如 GRANT SELECT ON TABLE table_name),只有 super 用户可以撤销它们。 有没有其他 super
我试过使用文档 here但似乎没有帮助。如果可以请给我一个例子。 revoke select (column1, column2) on table from specific_user 没用。 Ac
有没有一种方法可以撤销用户对目录对象(即 information_schema)和 PostgreSQL 表(即 pg_catalog)的权限?我已经尝试了几件事并搜索了网络。我没有任何运气。我读到的
在我的应用程序中,我使用的是 APNS。我已经制作了证书,但我对使用感到困惑。我收到以下错误。 Warning: stream_socket_client(): SSL operation faile
[我检查过类似的帖子,我的问题与其他人的问题略有不同,因为我们有多个应用程序在一个证书下签名] 我们受委托(delegate)为客户开发现有的 iOS 应用程序,现在需要使用他们的证书将其分发到应用程
我的 APNs 证书即将到期,所以我撤销了 APNs 证书(只是为了确保一切正常)。但是 30 分钟后我仍然收到测试推送通知。是因为苹果的缓存吗?会持续多久? 最佳答案 根据您的问题,您的旧证书尚未过
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 关于您编写的代码问题的问题必须在问题本身中描述具体问题 — 并且包括有效代码 以重现它。参见 SSC
是否可以在 C# 中执行类似的操作? logger != null ? logger.Log(消息) : ;//如果为 null 则什么都不做 或 记录器!?? logger.Log(消息);//只有
我不小心执行了以下命令: git rm -r . 毫不奇怪,它删除了所有内容。有什么办法可以恢复吗? 最佳答案 尝试: git reset HEAD 如果您没有任何您关心的未提交的更改,那么 git
我们有一个已授予某些权限的应用程序。然后用户从设置 -> 应用程序 -> 权限撤销权限。我提到该应用此时处于后台。 有时,应用会在上述流程发生时崩溃。有什么办法可以解决这个问题吗?我们可以知道何时从应
如何使用 AnkhSvn/VS 2010 撤消/恢复我已提交的更改。 (我很清楚您不能“删除”subversion 存储库中的内容)。 问题很简单, 您正在处理 HEAD(例如 rev 100)。你发
我想知道是否可以撤销 ThinkTecture Identity Server 颁发的 OAuth 2.0 token ,因为我想让我的应用程序注销。 最佳答案 这仅适用于实现 RFC 7009 的
我有一个 grails 应用程序,我希望用户授予我访问他/她的 LinkedIn 帐户的权限,以获取信息并以不同的方式显示它。 我能够做到以下几点: 获取授权码 使用该授权码获取访问 token 我将
我是一名优秀的程序员,十分优秀!