{"action":"created","issue":{"url":"https://api.github.com/repos/cozy/cozy-stack/issues/1610","repository_url":"https://api.github.com/repos/cozy/cozy-stack","labels_url":"https://api.github.com/repos/cozy/cozy-stack/issues/1610/labels{/name}","comments_url":"https://api.github.com/repos/cozy/cozy-stack/issues/1610/comments","events_url":"https://api.github.com/repos/cozy/cozy-stack/issues/1610/events","html_url":"https://github.com/cozy/cozy-stack/issues/1610","id":376368199,"node_id":"MDU6SXNzdWUzNzYzNjgxOTk=","number":1610,"title":"OAuth register endpoint should have CORS enabled","user":{"login":"ptbrowne","id":465582,"node_id":"MDQ6VXNlcjQ2NTU4Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/465582?v=4","gravatar_id":"","url":"https://api.github.com/users/ptbrowne","html_url":"https://github.com/ptbrowne","followers_url":"https://api.github.com/users/ptbrowne/followers","following_url":"https://api.github.com/users/ptbrowne/following{/other_user}","gists_url":"https://api.github.com/users/ptbrowne/gists{/gist_id}","starred_url":"https://api.github.com/users/ptbrowne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptbrowne/subscriptions","organizations_url":"https://api.github.com/users/ptbrowne/orgs","repos_url":"https://api.github.com/users/ptbrowne/repos","events_url":"https://api.github.com/users/ptbrowne/events{/privacy}","received_events_url":"https://api.github.com/users/ptbrowne/received_events","type":"User","site_admin":false},"labels":[{"id":408851000,"node_id":"MDU6TGFiZWw0MDg4NTEwMDA=","url":"https://api.github.com/repos/cozy/cozy-stack/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-11-01T12:14:26Z","updated_at":"2018-12-14T12:37:40Z","closed_at":null,"author_association":"MEMBER","body":"If I try to instantiate an OAuth client from a webpage, it fails because there are no \"Access-Control-Allow-Origin\" served from the `register` endpoint.\r\n\r\nI think this should be relaxed as the `register` endpoint should be accessible from any webpage. \r\n\r\n```\r\nAccess to fetch at 'https://recette.cozy.works/auth/register' from origin 'http://localhost:1234' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.\r\n_fails.js:8 Uncaught (in promise) TypeError: Failed to fetch\r\n```"},"comment":{"url":"https://api.github.com/repos/cozy/cozy-stack/issues/comments/447312980","html_url":"https://github.com/cozy/cozy-stack/issues/1610#issuecomment-447312980","issue_url":"https://api.github.com/repos/cozy/cozy-stack/issues/1610","id":447312980,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzMxMjk4MA==","user":{"login":"y-lohse","id":2261445,"node_id":"MDQ6VXNlcjIyNjE0NDU=","avatar_url":"https://avatars2.githubusercontent.com/u/2261445?v=4","gravatar_id":"","url":"https://api.github.com/users/y-lohse","html_url":"https://github.com/y-lohse","followers_url":"https://api.github.com/users/y-lohse/followers","following_url":"https://api.github.com/users/y-lohse/following{/other_user}","gists_url":"https://api.github.com/users/y-lohse/gists{/gist_id}","starred_url":"https://api.github.com/users/y-lohse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-lohse/subscriptions","organizations_url":"https://api.github.com/users/y-lohse/orgs","repos_url":"https://api.github.com/users/y-lohse/repos","events_url":"https://api.github.com/users/y-lohse/events{/privacy}","received_events_url":"https://api.github.com/users/y-lohse/received_events","type":"User","site_admin":false},"created_at":"2018-12-14T12:37:40Z","updated_at":"2018-12-14T12:37:40Z","author_association":"MEMBER","body":"Well, we essentially want to do [this](https://docs.cozy.io/en/cozy-stack/auth/#third-party-websites), which isn't possible at the moment. We'd definitely need `/auth/register`, but I think we also need `/auth/access_token` to complete the oauth flow. The other `/auth` routes might not be needed for basic use cases.\r\n\r\n> and I didn't have time to look at this since the issue is opened\r\n\r\nNo problem :)\r\n"}}
{"actor":{"display_login":"y-lohse"}}