{"action":"opened","issue":{"url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-objc/issues/274","repository_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-objc","labels_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-objc/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-objc/issues/274/comments","events_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-objc/issues/274/events","html_url":"https://github.com/AzureAD/microsoft-authentication-library-for-objc/issues/274","id":324263213,"number":274,"title":"Changing kAuthority to consumers doesn't work","user":{"login":"jthake","id":6786616,"avatar_url":"https://avatars1.githubusercontent.com/u/6786616?v=4","gravatar_id":"","url":"https://api.github.com/users/jthake","html_url":"https://github.com/jthake","followers_url":"https://api.github.com/users/jthake/followers","following_url":"https://api.github.com/users/jthake/following{/other_user}","gists_url":"https://api.github.com/users/jthake/gists{/gist_id}","starred_url":"https://api.github.com/users/jthake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jthake/subscriptions","organizations_url":"https://api.github.com/users/jthake/orgs","repos_url":"https://api.github.com/users/jthake/repos","events_url":"https://api.github.com/users/jthake/events{/privacy}","received_events_url":"https://api.github.com/users/jthake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-18T04:03:47Z","updated_at":"2018-05-18T04:03:47Z","closed_at":null,"author_association":"NONE","body":"I'm using the MSAL Preview for iOS and this[ swift sample](https://github.com/Azure-Samples/active-directory-ios-swift-native-v2).\r\n\r\nBased on the [documentation here](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints), I should be using consumers not common to force it to Personal accounts only.\r\n\r\nIn the [ViewDidLoad function](https://github.com/Azure-Samples/active-directory-ios-swift-native-v2/blob/323c9e884968f45760f62a5b9aef3e4b6e8127ed/MSALiOS/ViewController.swift#L206)\r\n\r\n`self.applicationContext = try MSALPublicClientApplication.init(clientId: kClientID, authority: kAuthority)`\r\nChanging kAuthority to\r\n\r\n`https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize`\r\nShould lock it to consumer accounts only.\r\n\r\nBut this seems to throw an error of \"This doesn't look like a work or school email. You can't sign in here iwth a personal account. User your work or school account instead.\" It does work for that kAuthority if i put in org account.\r\n\r\nIf i change to\r\n\r\n`https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize`\r\nIt allows allows org in but not consumer account.\r\n\r\nBoth work if I set back to code sample default of\r\n\r\n`https://login.microsoftonline.com/common/oauth2/v2.0/authorize`\r\nI have noticed that if I hit this in a browser\r\n\r\n`https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?client_id=##clientid##&response_type=code&redirect_uri=http%3A%2F%2Flocalhost&response_mode=query&scope=openid%20offline_access%20https%3A%2F%2Fgraph.microsoft.com%2Fmail.read&state=12345`\r\nthis works fine in a browser. So I don't think its an application configuration issue. unless its to do with native vs web calling this?\r\n\r\nI noticed in the latest sample , kAuthority has been shortened.\r\n\r\n`let kAuthority = \"https://login.microsoftonline.com/common/\"`\r\nTried this and doesn't make a difference."}}
{"actor":{"display_login":"jthake"}}