Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不同用户登录的iOS ADAL异常_Ios_Azure_Azure Active Directory_Adal_Azure Ad Graph Api - Fatal编程技术网

不同用户登录的iOS ADAL异常

不同用户登录的iOS ADAL异常,ios,azure,azure-active-directory,adal,azure-ad-graph-api,Ios,Azure,Azure Active Directory,Adal,Azure Ad Graph Api,我正在使用ADAL iOS库进行Azure身份验证。但是,如果我先使用一个帐户登录,然后注销并使用另一个帐户登录,我会遇到问题。即使我设置了“AD_PROMPT_ALWAYS”,我还是会出现以下错误 2015-08-31 12:50:39.939 PortalDev[908:174411] ADALiOS [2015-08-31 11:50:39 - xxx-xxx-xxx-xxx-xxx] ERROR: Error raised: 19. Additional Information: Dom

我正在使用ADAL iOS库进行Azure身份验证。但是,如果我先使用一个帐户登录,然后注销并使用另一个帐户登录,我会遇到问题。即使我设置了“AD_PROMPT_ALWAYS”,我还是会出现以下错误

2015-08-31 12:50:39.939 PortalDev[908:174411] ADALiOS [2015-08-31 11:50:39 - xxx-xxx-xxx-xxx-xxx] ERROR: Error raised: 19. Additional Information: Domain: ADAuthenticationErrorDomain ProtocolCode:(null) Details:Different user was authenticated. Expected: 'aaa@xxx.com'; Actual: 'bbb@xxx.com'. Either the user entered credentials for different user, or cookie for different logged user is present. Consider calling acquireToken with AD_PROMPT_ALWAYS to ignore the cookie.. ErrorCode: 19.
2015-08-31 12:50:39.943 PortalDev[908:174411] ADAL Error: 19, Different user was authenticated. Expected: 'aaa@xxx.com'; Actual: 'bbb@xxx.com'. Either the user entered credentials for different user, or cookie for different logged user is present. Consider calling acquireToken with AD_PROMPT_ALWAYS to ignore the cookie. (status: 2)
我清除了缓存,尝试并清除了cookies,我想:

if (allItems.count > 0) {
            [cache removeAllWithError:&error];
            if (error) {
                CLSNSLog(@"Error clearing cache: %@", error.errorDetails);
            } else {
                CLSNSLog(@"Items removed.");
            }
        } else {
            CLSNSLog(@"Was no user cached.");
        }


        NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
        NSArray* cookies = cookieStorage.cookies;
        if (cookies.count)
        {
            for(NSHTTPCookie* cookie in cookies)
            {
                CLSNSLog(@"Deleting Auth Cookie %@.", cookie.name);
                [cookieStorage deleteCookie:cookie];
            }
            CLSNSLog(@"Auth Cookies cleared.");
        }
但我不认为有任何饼干需要清理。 当我获得登录网页时,用户名已预先填充。几个星期/几个月前我还以为它工作得很好,但现在似乎出现了问题。我今天从最新的GitHub源代码构建了全新的库


有什么建议可以让切换用户名成为可能吗?

错误消息显示:

预期:'aaa@xxx.com'; 实际:'bbb@xxx.com"

表示用户ID参数正在传递给acquireToken。这将导致在登录页面中预先填充用户名字段。但是,错误是当用户登录时,他们将用户名字段更改为其他用户。因为您请求了一个特定的用户,但没有获得该用户的令牌,所以acquireToken返回一个错误。有关更多详细信息,请参见此答案:


但愿我几天前就意识到这一点。我确实传递了用户名(如果知道的话),以便于第二次登录,但没有意识到这是问题的原因。我以为只是为了预先填好表格。。。应该再尖锐一点!