{"action":"created","issue":{"url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/127","repository_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios","labels_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/127/comments","events_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/127/events","html_url":"https://github.com/OneDrive/onedrive-sdk-ios/issues/127","id":163216657,"number":127,"title":"user_id/authentication_token?","user":{"login":"wang2nd","id":1638140,"avatar_url":"https://avatars.githubusercontent.com/u/1638140?v=3","gravatar_id":"","url":"https://api.github.com/users/wang2nd","html_url":"https://github.com/wang2nd","followers_url":"https://api.github.com/users/wang2nd/followers","following_url":"https://api.github.com/users/wang2nd/following{/other_user}","gists_url":"https://api.github.com/users/wang2nd/gists{/gist_id}","starred_url":"https://api.github.com/users/wang2nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wang2nd/subscriptions","organizations_url":"https://api.github.com/users/wang2nd/orgs","repos_url":"https://api.github.com/users/wang2nd/repos","events_url":"https://api.github.com/users/wang2nd/events{/privacy}","received_events_url":"https://api.github.com/users/wang2nd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-30T17:09:39Z","updated_at":"2016-07-05T20:15:30Z","closed_at":"2016-07-05T20:15:30Z","body":"If using Microsoft Personal Account to sign in from a Mobile App through the windows live authentication,\r\nwithin the token response we get, there is not any authentication_code according to Windows Live OAuth2 Response Parameters definition(https://msdn.microsoft.com/en-us/library/hh243647.aspx#response), instead we got the user_id, it is not a JWT token, the value is something like \"AAAAAAAAAAAAAAAAAAAAAF82T9eFNt4sYYyv7hxFtNQ\". The access_token itself is not a JWT token either. \r\n\r\nIf using Microsoft Work Account to sign in as a Mobile App through the Azure AD authentication, within the token response we get, it contains an id_token, which is a JWT token but not signed. But gladly the access_token itself is a signed JWT token so that we can verify it is issued by Microsoft and trust the identity. \r\n\r\nThe accountSessionWithResponse code(especially the comments '// Active Directory obfuscates the id and calls it id_token') in ODAuthHelper.m confirms the observations based on testing.\r\n \r\nIn General, we need a workaround for using Microsoft Personal Account to sign in from a Mobile App case, which can give us a signed token so that we can verify that it is signed by Microsoft and trust the info contained in the token and be able to link that info back to an actual user profile.\r\n\r\nFor Microsoft Work or School Account, no matter MobileApp or Web App, we rely on access_token and id_token.\r\nFor Microsoft Personal Account from Web App, we have the authentication_code, but for Mobile App, we need some guidance to take advantage of this user_id or some kind of signed token. Any link or hints?\r\n\r\nThanks,"},"comment":{"url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/comments/230589763","html_url":"https://github.com/OneDrive/onedrive-sdk-ios/issues/127#issuecomment-230589763","issue_url":"https://api.github.com/repos/OneDrive/onedrive-sdk-ios/issues/127","id":230589763,"user":{"login":"wang2nd","id":1638140,"avatar_url":"https://avatars.githubusercontent.com/u/1638140?v=3","gravatar_id":"","url":"https://api.github.com/users/wang2nd","html_url":"https://github.com/wang2nd","followers_url":"https://api.github.com/users/wang2nd/followers","following_url":"https://api.github.com/users/wang2nd/following{/other_user}","gists_url":"https://api.github.com/users/wang2nd/gists{/gist_id}","starred_url":"https://api.github.com/users/wang2nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wang2nd/subscriptions","organizations_url":"https://api.github.com/users/wang2nd/orgs","repos_url":"https://api.github.com/users/wang2nd/repos","events_url":"https://api.github.com/users/wang2nd/events{/privacy}","received_events_url":"https://api.github.com/users/wang2nd/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T20:15:30Z","updated_at":"2016-07-05T20:15:30Z","body":"This issue can be closed since the the accountId in the AccountSession object for Microsoft Personal Account will stand for \r\n\r\n- user_id if you dont request the openid scope\r\n- id_token if you request the openid scope"}}
{"actor":{"display_login":"wang2nd"}}