我正在測試Azure雲移動應用程序,並下載了入門部分提供的示例應用程序。我還配置了用於認證的Azure Active Directory。Azure iOS應用程序身份驗證錯誤
當我運行在iOS模擬器的應用程序,我在終端說法得到一個錯誤:
ERROR Error Domain=com.Microsoft.MicrosoftAzureMobile.ErrorDomain Code=-1302 "You must be logged in to use this application" UserInfo={com.Microsoft.MicrosoftAzureMobile.ErrorResponseKey= { URL: https://appname.azurewebsites.net/tables/TodoItem } { status code: 401, headers { "Content-Length" = 45; "Content-Type" = "text/html; charset=utf-8"; Date = "Sat, 25 Jun 2016 10:46:04 GMT"; Etag = "W/\"2d-vonn2FgYR/Z6jU4A0udEWA\""; Server = "Microsoft-IIS/8.0"; "Set-Cookie" = "ARRAffinity=155c1827c98c621a5b3208e361587e118813cc4207f5ad4c23e121c5c10fd7bf;Path=/;Domain=appname.azurewebsites.net"; "X-Powered-By" = "Express, ASP.NET"; } }, NSLocalizedDescription=You must be logged in to use this application, com.Microsoft.MicrosoftAzureMobile.ErrorRequestKey= { URL: https://appname.azurewebsites.net/tables/TodoItem }} Error: Error Domain=com.Microsoft.MicrosoftAzureMobile.ErrorDomain Code=-1173 "Push aborted due to authentication error" UserInfo={NSLocalizedDescription=Push aborted due to authentication error, NSUnderlyingError=0x7f84fb1bd910 {Error Domain=com.Microsoft.MicrosoftAzureMobile.ErrorDomain Code=-1302 "You must be logged in to use this application" UserInfo={com.Microsoft.MicrosoftAzureMobile.ErrorResponseKey= { URL: https://appname.azurewebsites.net/tables/TodoItem } { status code: 401, headers { "Content-Length" = 45; "Content-Type" = "text/html; charset=utf-8"; Date = "Sat, 25 Jun 2016 10:46:04 GMT"; Etag = "W/\"2d-vonn2FgYR/Z6jU4A0udEWA\""; Server = "Microsoft-IIS/8.0"; "X-Powered-By" = "Express, ASP.NET"; } }, NSLocalizedDescription=You must be logged in to use this application, com.Microsoft.MicrosoftAzureMobile.ErrorRequestKey= { URL: https://appame.azurewebsites.net/tables/TodoItem }}}}
儘管如此,應用程序是工作,我可以節省的項目和加載數據。我如何解決以下問題?
你是如何配置後端的?您是否將認證/授權默認操作設置爲「允許請求」? (這是必需的,以便應用程序控制auth而不是前端處理器) –