{"action":"created","issue":{"url":"https://api.github.com/repos/contao/core-bundle/issues/685","repository_url":"https://api.github.com/repos/contao/core-bundle","labels_url":"https://api.github.com/repos/contao/core-bundle/issues/685/labels{/name}","comments_url":"https://api.github.com/repos/contao/core-bundle/issues/685/comments","events_url":"https://api.github.com/repos/contao/core-bundle/issues/685/events","html_url":"https://github.com/contao/core-bundle/pull/685","id":202870510,"number":685,"title":"[RTM] Use Symfony Security for authentication purposes in Contao","user":{"login":"bytehead","id":754921,"avatar_url":"https://avatars3.githubusercontent.com/u/754921?v=4","gravatar_id":"","url":"https://api.github.com/users/bytehead","html_url":"https://github.com/bytehead","followers_url":"https://api.github.com/users/bytehead/followers","following_url":"https://api.github.com/users/bytehead/following{/other_user}","gists_url":"https://api.github.com/users/bytehead/gists{/gist_id}","starred_url":"https://api.github.com/users/bytehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bytehead/subscriptions","organizations_url":"https://api.github.com/users/bytehead/orgs","repos_url":"https://api.github.com/users/bytehead/repos","events_url":"https://api.github.com/users/bytehead/events{/privacy}","received_events_url":"https://api.github.com/users/bytehead/received_events","type":"User","site_admin":false},"labels":[{"id":104721160,"url":"https://api.github.com/repos/contao/core-bundle/labels/feature","name":"feature","color":"3364b7","default":false}],"state":"open","locked":false,"assignee":{"login":"bytehead","id":754921,"avatar_url":"https://avatars3.githubusercontent.com/u/754921?v=4","gravatar_id":"","url":"https://api.github.com/users/bytehead","html_url":"https://github.com/bytehead","followers_url":"https://api.github.com/users/bytehead/followers","following_url":"https://api.github.com/users/bytehead/following{/other_user}","gists_url":"https://api.github.com/users/bytehead/gists{/gist_id}","starred_url":"https://api.github.com/users/bytehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bytehead/subscriptions","organizations_url":"https://api.github.com/users/bytehead/orgs","repos_url":"https://api.github.com/users/bytehead/repos","events_url":"https://api.github.com/users/bytehead/events{/privacy}","received_events_url":"https://api.github.com/users/bytehead/received_events","type":"User","site_admin":false},"assignees":[{"login":"bytehead","id":754921,"avatar_url":"https://avatars3.githubusercontent.com/u/754921?v=4","gravatar_id":"","url":"https://api.github.com/users/bytehead","html_url":"https://github.com/bytehead","followers_url":"https://api.github.com/users/bytehead/followers","following_url":"https://api.github.com/users/bytehead/following{/other_user}","gists_url":"https://api.github.com/users/bytehead/gists{/gist_id}","starred_url":"https://api.github.com/users/bytehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bytehead/subscriptions","organizations_url":"https://api.github.com/users/bytehead/orgs","repos_url":"https://api.github.com/users/bytehead/repos","events_url":"https://api.github.com/users/bytehead/events{/privacy}","received_events_url":"https://api.github.com/users/bytehead/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/contao/core-bundle/milestones/23","html_url":"https://github.com/contao/core-bundle/milestone/23","labels_url":"https://api.github.com/repos/contao/core-bundle/milestones/23/labels","id":2327954,"number":23,"title":"4.5.0","description":"","creator":{"login":"leofeyer","id":1192057,"avatar_url":"https://avatars0.githubusercontent.com/u/1192057?v=4","gravatar_id":"","url":"https://api.github.com/users/leofeyer","html_url":"https://github.com/leofeyer","followers_url":"https://api.github.com/users/leofeyer/followers","following_url":"https://api.github.com/users/leofeyer/following{/other_user}","gists_url":"https://api.github.com/users/leofeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/leofeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leofeyer/subscriptions","organizations_url":"https://api.github.com/users/leofeyer/orgs","repos_url":"https://api.github.com/users/leofeyer/repos","events_url":"https://api.github.com/users/leofeyer/events{/privacy}","received_events_url":"https://api.github.com/users/leofeyer/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":48,"state":"open","created_at":"2017-02-16T16:29:11Z","updated_at":"2017-12-04T16:22:09Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2017-01-24T16:33:44Z","updated_at":"2017-12-12T10:22:24Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/contao/core-bundle/pulls/685","html_url":"https://github.com/contao/core-bundle/pull/685","diff_url":"https://github.com/contao/core-bundle/pull/685.diff","patch_url":"https://github.com/contao/core-bundle/pull/685.patch"},"body":"This is a working draft to replace the current `simple_preauth` mechanism to login backend users and frontend members with the `form_login` from the Symfony Security Component.\r\n\r\nPlease review and mention all missed topics.\r\n\r\n### ToDos:\r\n- [x] Keep redirect on login\r\n- [x] Implement role switcher / impersonate any `BackendUser`\r\n- [x] Session Life Time (`framework.session.cookie_lifetime`)\r\n- [x] Rename firewalls (prefix with `contao_`)\r\n- [x] Implement Security for `FrontendUser`\r\n- [x] Replace `postAuthenticate`\r\n- [x] Replace `postLogin`\r\n- [x] Replace `checkCredentials` (needs a custom `AuthenticationProvider`)\r\n- [x] Replace `importUser`\r\n- [x] Replace `postLogout`\r\n- [x] Replace current `accountLocked` stuff\r\n- [x] Test Frontend Preview\r\n- [x] Write tests\r\n- [x] Check Code style\r\n- [x] Deprecate all old hooks\r\n- [x] Provide Event for legacy `postAuthenticate` hook\r\n- [x] Provide Event for legacy `checkCredentials` hook\r\n- [x] Provide Event for legacy `importUser` hook\r\n- [x] Provide Event for legacy `postLogout` hook\r\n- [x] Show backend login errors\r\n\r\n### Fixes needed:\r\n- [x] ~~Backend login redirect: Simple test: login, go somewhere, delete your session cookie.~~\r\n- [x] UserProvider refreshUser without credentials\r\n- [x] Provide exception messages\r\n- [x] Replace usage of static legacy class methods (e.g. `Config`, `Environment`)\r\n- [x] Call `importUser` only on `POST` request\r\n- [x] Additional check with `UserChecker` in [`Frontend`](https://github.com/contao/core-bundle/pull/685#pullrequestreview-78677905) \r\n- [x] Implement the `EquatableInterface` on User to compare the token object and DB object\r\n- [x] on `BackendUser::getInstance` check if there is a valid `_security_contao_backend` token in the actual session to restore the user from\r\n- [x] on `FrontendUser::getInstance` check if there is a valid `_security_contao_frontend` token in the actual session to restore the user from\r\n\r\n### Nice to have (possibly future PRs):\r\n- use `DoctrineTokenProvider` for persistent remember me tokens\r\n\r\n### Possible new features (future PRs):\r\n\r\n- Allow login also with the email address (not only username)\r\n- Allow some user action via command like `activate`, `change-password` or similar\r\n"},"comment":{"url":"https://api.github.com/repos/contao/core-bundle/issues/comments/351008788","html_url":"https://github.com/contao/core-bundle/pull/685#issuecomment-351008788","issue_url":"https://api.github.com/repos/contao/core-bundle/issues/685","id":351008788,"user":{"login":"leofeyer","id":1192057,"avatar_url":"https://avatars0.githubusercontent.com/u/1192057?v=4","gravatar_id":"","url":"https://api.github.com/users/leofeyer","html_url":"https://github.com/leofeyer","followers_url":"https://api.github.com/users/leofeyer/followers","following_url":"https://api.github.com/users/leofeyer/following{/other_user}","gists_url":"https://api.github.com/users/leofeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/leofeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leofeyer/subscriptions","organizations_url":"https://api.github.com/users/leofeyer/orgs","repos_url":"https://api.github.com/users/leofeyer/repos","events_url":"https://api.github.com/users/leofeyer/events{/privacy}","received_events_url":"https://api.github.com/users/leofeyer/received_events","type":"User","site_admin":false},"created_at":"2017-12-12T10:22:23Z","updated_at":"2017-12-12T10:22:23Z","author_association":"OWNER","body":"The PR is almost ready to merge. There are two open issues:\r\n\r\n1. Do we want to log impersonations?\r\n2. Do we need to change any `private` variables or methods to `protected` so people can overwrite certain things?\r\n\r\nRegarding 1.: We are logging \"switch user\" actions but not \"log in as member\" actions. Is this ok or should we log both or none?\r\n"}}
{"actor":{"display_login":"leofeyer"}}