{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/20045","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/20045/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/20045/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/20045/events","html_url":"https://github.com/symfony/symfony/issues/20045","id":179025853,"number":20045,"title":"[DX] Define a default encoder for in-memory users","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/DX","name":"DX","color":"5319e7"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Enhancement","name":"Enhancement","color":"02d7e1"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Security","name":"Security","color":"DDDDDD"},{"url":"https://api.github.com/repos/symfony/symfony/labels/SecurityBundle","name":"SecurityBundle","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2016-09-24T11:31:52Z","updated_at":"2016-10-03T14:32:18Z","closed_at":null,"body":"### Context\r\n\r\nA fresh new Symfony app has the following security configuration (no encoder is defined):\r\n\r\n```yaml\r\nsecurity:\r\n\r\n    providers:\r\n        in_memory:\r\n            memory: ~\r\n\r\n    firewalls:\r\n        # ...\r\n```\r\n\r\n### Problem\r\n\r\nIf you add some in memory users:\r\n\r\n```yaml\r\nsecurity:\r\n\r\n    providers:\r\n        in_memory:\r\n            memory:\r\n                users:\r\n                    admin: { password: 1234 }\r\n\r\n    firewalls:\r\n        # ...\r\n```\r\n\r\nYou'll see the following error:\r\n\r\n```\r\nNo encoder has been configured for account \"Symfony\\Component\\Security\\Core\\User\\User\".\r\n```\r\n\r\nThen you must define the encoder for that \"strange\" user class provided by Symfony:\r\n\r\n```yaml\r\nsecurity:\r\n    encoders:\r\n        Symfony\\Component\\Security\\Core\\User\\User: plaintext\r\n\r\n    providers:\r\n        in_memory:\r\n            memory:\r\n                # ...\r\n```\r\n\r\n### Solution\r\n\r\nSymfony could define `plaintext` as the default encoder of the in-memory users. This shouldn't be a security issue because developers will always define later the appropriate algorithm for them. But this is a minor DX improvement because it avoids this strange initial error."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/251121478","html_url":"https://github.com/symfony/symfony/issues/20045#issuecomment-251121478","issue_url":"https://api.github.com/repos/symfony/symfony/issues/20045","id":251121478,"user":{"login":"armellin","id":16577708,"avatar_url":"https://avatars.githubusercontent.com/u/16577708?v=3","gravatar_id":"","url":"https://api.github.com/users/armellin","html_url":"https://github.com/armellin","followers_url":"https://api.github.com/users/armellin/followers","following_url":"https://api.github.com/users/armellin/following{/other_user}","gists_url":"https://api.github.com/users/armellin/gists{/gist_id}","starred_url":"https://api.github.com/users/armellin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armellin/subscriptions","organizations_url":"https://api.github.com/users/armellin/orgs","repos_url":"https://api.github.com/users/armellin/repos","events_url":"https://api.github.com/users/armellin/events{/privacy}","received_events_url":"https://api.github.com/users/armellin/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T14:32:18Z","updated_at":"2016-10-03T14:32:18Z","body":"@stof Maybe \"Installing & Setting up the Symfony Framework\" should mention that, because the Symfony Installer might not be an option in some environments. Anyway, I am afraid that I unpolitely digressed from the original topic."}}
{"actor":{"display_login":"armellin"}}