{"action":"created","issue":{"url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/95","repository_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios","labels_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/95/comments","events_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/95/events","html_url":"https://github.com/OneDrive/onedrive-sdk-ios/issues/95","id":154452876,"number":95,"title":"OneDrive for Business: wrong address of serviceEndpointUri and serviceResourceId","user":{"login":"trzeciak","id":11998334,"avatar_url":"https://avatars.githubusercontent.com/u/11998334?v=3","gravatar_id":"","url":"https://api.github.com/users/trzeciak","html_url":"https://github.com/trzeciak","followers_url":"https://api.github.com/users/trzeciak/followers","following_url":"https://api.github.com/users/trzeciak/following{/other_user}","gists_url":"https://api.github.com/users/trzeciak/gists{/gist_id}","starred_url":"https://api.github.com/users/trzeciak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trzeciak/subscriptions","organizations_url":"https://api.github.com/users/trzeciak/orgs","repos_url":"https://api.github.com/users/trzeciak/repos","events_url":"https://api.github.com/users/trzeciak/events{/privacy}","received_events_url":"https://api.github.com/users/trzeciak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"rgregg","id":1435771,"avatar_url":"https://avatars.githubusercontent.com/u/1435771?v=3","gravatar_id":"","url":"https://api.github.com/users/rgregg","html_url":"https://github.com/rgregg","followers_url":"https://api.github.com/users/rgregg/followers","following_url":"https://api.github.com/users/rgregg/following{/other_user}","gists_url":"https://api.github.com/users/rgregg/gists{/gist_id}","starred_url":"https://api.github.com/users/rgregg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgregg/subscriptions","organizations_url":"https://api.github.com/users/rgregg/orgs","repos_url":"https://api.github.com/users/rgregg/repos","events_url":"https://api.github.com/users/rgregg/events{/privacy}","received_events_url":"https://api.github.com/users/rgregg/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-05-12T10:49:01Z","updated_at":"2016-05-24T09:44:32Z","closed_at":null,"body":"Hi all,\r\nIn our app we integrate a lot of external sources, among them OneDrive.\r\n\r\nWe are integrated with OneDrive (before SkyDrive) since a couple of years. \r\nLast year, as it was asked by our users to support ODfB, we changed the SDK into OneDrive SDK (from CocoaPods, interference was the pod ADALiOS). It worked well.\r\n\r\nHowever, since last month this integration stopped to work. Please see below detailed information.\r\n\r\nCurrently during log in to ODfB account, we get error:\r\n\r\n> “There was a problem logging you in.\r\n> Could not discover the api endpoint for the given user.  Make sure you have correctly enabled the SharePoint files permissions in Azure portal.\" Error code: 1\r\n\r\nThe Access settings should be correct, we set these with this instructions:\r\nhttps://dev.onedrive.com/app-registration.htm#3-register-your-app-with-azure-active-directory\r\n\r\nWe have a problem with getting the correct address of `resources URL`\r\nhttps://dev.onedrive.com/auth/aad_oauth.htm#step-3-discover-the-onedrive-for-business-resource-uri\r\n\r\nWhen we send request for **services**:\r\nhttps://api.office.com/discovery/v2.0/me/services\r\nin response we get only **capability** of **Directory**, and not like in documentation: **MyFiles**.\r\n```\r\n{\r\n    \"@odata.context\" = \"https://api.office.com/discovery/v2.0/me/$metadata#allServices\";\r\n    value =     (\r\n                {\r\n            \"@odata.editLink\" = \"services('Directory@AZURE@v1.0')\";\r\n            \"@odata.id\" = \"https://api.office.com/discovery/v2.0/me/services('Directory@AZURE@v1.0')\";\r\n            \"@odata.type\" = \"#Microsoft.DiscoveryServices.ServiceInfo\";\r\n            capability = Directory;\r\n            entityKey = \"Directory@AZURE@v1.0\";\r\n            providerId = \"…\";\r\n            providerName = Microsoft;\r\n            serviceAccountType = 2;\r\n            serviceApiVersion = \"v1.0\";\r\n            serviceEndpointUri = \"https://graph.windows.net/miknobuisness.onmicrosoft.com/\";\r\n            serviceId = AZURE;\r\n            serviceName = \"Microsoft Azure\";\r\n            serviceResourceId = \"https://graph.windows.net/\";\r\n        }\r\n    );\r\n}\r\n```\r\n\r\nWhen we request other rest: **allServices**, the response has more descriptions:\r\nhttps://api.office.com/discovery/v2.0/me/allServices\r\n```\r\n{\r\n    \"@odata.context\" = \"https://api.office.com/discovery/v2.0/me/$metadata#allServices\";\r\n    value =     (\r\n                {\r\n            \"@odata.editLink\" = \"allservices('Directory@AZURE')\";\r\n            \"@odata.id\" = \"https://api.office.com/discovery/v2.0/me/allservices('Directory@AZURE')\";\r\n            \"@odata.type\" = \"#Microsoft.DiscoveryServices.ServiceInfo\";\r\n            capability = Directory;\r\n            entityKey = \"Directory@AZURE\";\r\n            providerId = \"72f988bf-86f1-41af-91ab-2d7cd011db47\";\r\n            providerName = Microsoft;\r\n            serviceAccountType = 2;\r\n            serviceApiVersion = \"\";\r\n            serviceEndpointUri = \"http://azure.microsoft.com/\";\r\n            serviceId = AZURE;\r\n            serviceName = \"Microsoft Azure\";\r\n            serviceResourceId = \"<null>\";\r\n},\r\n{…},\r\n{\r\n            \"@odata.editLink\" = \"allservices('MyFiles@O365_SHAREPOINT')\";\r\n            \"@odata.id\" = \"https://api.office.com/discovery/v2.0/me/allservices('MyFiles@O365_SHAREPOINT')\";\r\n            \"@odata.type\" = \"#Microsoft.DiscoveryServices.ServiceInfo\";\r\n            capability = MyFiles;\r\n            entityKey = \"MyFiles@O365_SHAREPOINT\";\r\n            providerId = \"72f988bf-86f1-41af-91ab-2d7cd011db47\";\r\n            providerName = Microsoft;\r\n            serviceAccountType = 2;\r\n            serviceApiVersion = \"\";\r\n            serviceEndpointUri = \"http://www.microsoft.com/en-us/office365/online-software.aspx\";\r\n            serviceId = \"O365_SHAREPOINT\";\r\n            serviceName = \"Office 365 SharePoint\";\r\n            serviceResourceId = \"<null>\";\r\n}\r\n```\r\n\r\nIn documentation is info about we should get address of **serviceEndpointUri** and **serviceResourceId**, but they are wrong.\r\n\r\nCan you help us please?"},"comment":{"url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/comments/221218889","html_url":"https://github.com/OneDrive/onedrive-sdk-ios/issues/95#issuecomment-221218889","issue_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/95","id":221218889,"user":{"login":"trzeciak","id":11998334,"avatar_url":"https://avatars.githubusercontent.com/u/11998334?v=3","gravatar_id":"","url":"https://api.github.com/users/trzeciak","html_url":"https://github.com/trzeciak","followers_url":"https://api.github.com/users/trzeciak/followers","following_url":"https://api.github.com/users/trzeciak/following{/other_user}","gists_url":"https://api.github.com/users/trzeciak/gists{/gist_id}","starred_url":"https://api.github.com/users/trzeciak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trzeciak/subscriptions","organizations_url":"https://api.github.com/users/trzeciak/orgs","repos_url":"https://api.github.com/users/trzeciak/repos","events_url":"https://api.github.com/users/trzeciak/events{/privacy}","received_events_url":"https://api.github.com/users/trzeciak/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T09:44:32Z","updated_at":"2016-05-24T09:44:32Z","body":"Yes, I have turned on \"Multi-tenant application\" option.\r\n\r\nOurs application on Azure AD is **native**, and:\r\n> Note that all Native client applications are multi-tenant by default as they are installed on the resource owner's device. See the Overview of the Consent Framework section above for more details on the consent framework\r\nhttps://azure.microsoft.com/pl-pl/documentation/articles/active-directory-integrating-applications/#configuring-multi-tenant-applications"}}
{"actor":{"display_login":"trzeciak"}}