{"action":"created","issue":{"url":"https://api.github.com/repos/Esri/arcgis-rest-js/issues/164","repository_url":"https://api.github.com/repos/Esri/arcgis-rest-js","labels_url":"https://api.github.com/repos/Esri/arcgis-rest-js/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/Esri/arcgis-rest-js/issues/164/comments","events_url":"https://api.github.com/repos/Esri/arcgis-rest-js/issues/164/events","html_url":"https://github.com/Esri/arcgis-rest-js/issues/164","id":309511210,"number":164,"title":"Using arcgis-rest-request when Portal is HTTPS only ","user":{"login":"jpeterson","id":3399064,"avatar_url":"https://avatars0.githubusercontent.com/u/3399064?v=4","gravatar_id":"","url":"https://api.github.com/users/jpeterson","html_url":"https://github.com/jpeterson","followers_url":"https://api.github.com/users/jpeterson/followers","following_url":"https://api.github.com/users/jpeterson/following{/other_user}","gists_url":"https://api.github.com/users/jpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/jpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpeterson/subscriptions","organizations_url":"https://api.github.com/users/jpeterson/orgs","repos_url":"https://api.github.com/users/jpeterson/repos","events_url":"https://api.github.com/users/jpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/jpeterson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-28T20:03:36Z","updated_at":"2018-03-30T19:08:23Z","closed_at":null,"author_association":"MEMBER","body":"I'm seeing some odd behavior when using the `request` method against an organization which has been configured to allow HTTPS only.\r\n\r\nGiven the following snippet:\r\n```js\r\nimport { request } from '@esri/arcgis-rest-request';\r\n\r\n// session === UserSession();\r\n\r\n// use request module to fetch user profile\r\nrequest(`${session.portal}/community/users/${session.username}`, {\r\n  authentication: session\r\n})\r\n```\r\n\r\nIf the organization has been configured for HTTPS only, I'm seeing the following network request:\r\n\r\n```\r\nhttps://a4iot.maps.arcgis.com/sharing/rest/community/users/jpeterson_iot&ssl=true\r\n```\r\n\r\nWhere the expected request is this:\r\n```\r\nhttps://a4iot.maps.arcgis.com/sharing/rest/community/users/jpeterson_iot\r\n```\r\n\r\nThis results in an error: `User does not exist or is inaccessible.`\r\n\r\n### Relevant Docs\r\n\r\nThe relevant Portal Self property is `allSSL`.\r\n(doc is here: https://developers.arcgis.com/rest/users-groups-and-items/portal-self.htm)\r\n\r\nIn case its helpful for discussion, the doc on this configuration option is here:\r\nhttps://doc.arcgis.com/en/arcgis-online/administer/configure-security.htm"},"comment":{"url":"https://api.github.com/repos/Esri/arcgis-rest-js/issues/comments/377599016","html_url":"https://github.com/Esri/arcgis-rest-js/issues/164#issuecomment-377599016","issue_url":"https://api.github.com/repos/Esri/arcgis-rest-js/issues/164","id":377599016,"user":{"login":"jgravois","id":3011734,"avatar_url":"https://avatars3.githubusercontent.com/u/3011734?v=4","gravatar_id":"","url":"https://api.github.com/users/jgravois","html_url":"https://github.com/jgravois","followers_url":"https://api.github.com/users/jgravois/followers","following_url":"https://api.github.com/users/jgravois/following{/other_user}","gists_url":"https://api.github.com/users/jgravois/gists{/gist_id}","starred_url":"https://api.github.com/users/jgravois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgravois/subscriptions","organizations_url":"https://api.github.com/users/jgravois/orgs","repos_url":"https://api.github.com/users/jgravois/repos","events_url":"https://api.github.com/users/jgravois/events{/privacy}","received_events_url":"https://api.github.com/users/jgravois/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T19:08:23Z","updated_at":"2018-03-30T19:08:23Z","author_association":"MEMBER","body":"this looks an awful lot like the bug i fixed way back in #143 and i can't repro against `master`\r\n\r\n```js\r\nconst session = new arcgisRest.UserSession({\r\n  username: \"johngdevprogram\",\r\n  password: \"[redacted]\",\r\n  portal: \"https://grogg.maps.arcgis.com/sharing/rest\"\r\n})\r\n\r\narcgisRest.request(`${session.portal}/community/users/${session.username}`, {\r\n  authentication: session\r\n})\r\n```\r\n![screenshot 2018-03-30 11 59 27](https://user-images.githubusercontent.com/3011734/38150019-d69c61a6-3411-11e8-972f-672db982dfbe.png)\r\n\r\ncan you test with our [`oauth2-browser`](https://github.com/Esri/arcgis-rest-js/tree/master/demos/oauth2-browser) to see whether it says your username is `jpeterson_iot&ssl=true` after you login using OAuth?\r\n"}}
{"actor":{"display_login":"jgravois"}}