{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/11155","labels_url":"https://api.github.com/repos/symfony/symfony/issues/11155/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/11155/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/11155/events","html_url":"https://github.com/symfony/symfony/issues/11155","id":35975988,"number":11155,"title":"Simplify/ease the User serialization requirement","user":{"login":"weaverryan","id":121003,"avatar_url":"https://avatars.githubusercontent.com/u/121003?v=3","gravatar_id":"","url":"https://api.github.com/users/weaverryan","html_url":"https://github.com/weaverryan","followers_url":"https://api.github.com/users/weaverryan/followers","following_url":"https://api.github.com/users/weaverryan/following{/other_user}","gists_url":"https://api.github.com/users/weaverryan/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverryan/subscriptions","organizations_url":"https://api.github.com/users/weaverryan/orgs","repos_url":"https://api.github.com/users/weaverryan/repos","events_url":"https://api.github.com/users/weaverryan/events{/privacy}","received_events_url":"https://api.github.com/users/weaverryan/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/Security","name":"Security","color":"DDDDDD"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-06-18T11:34:45Z","updated_at":"2015-02-11T16:47:57Z","closed_at":"2015-02-11T16:47:57Z","body":"*(this issue is part of the [\"DX\" (\"Developer eXperience\") initiative](http://symfony.com/blog/making-the-symfony-experience-exceptional) introduced by Symfony project)*\r\n\r\nIn most cases, your `User` object needs to implement `Serializable` - we cover it in the docs: http://symfony.com/doc/current/cookbook/security/entity_provider.html#the-data-model (search `What is the importance of serialize and unserialize?`). If you *don't* do this, you may get odd errors if you're using Doctrine.\r\n\r\nCould we make this more automatic? The fields that are serialized are important for [AbstractToken::hasUserChanged](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php#L243), and unless the developer chooses to explicitly implement `EquatableInterface`, we know exactly what fields need to be serialized.\r\n\r\nIn short, the problem is well-defined and is really an ugly implementation detail. So I want to see if we can do this for them, perhaps with an optional `AbstractUser`."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/73915939","html_url":"https://github.com/symfony/symfony/issues/11155#issuecomment-73915939","issue_url":"https://api.github.com/repos/symfony/symfony/issues/11155","id":73915939,"user":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?v=3","gravatar_id":"","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"created_at":"2015-02-11T16:47:57Z","updated_at":"2015-02-11T16:47:57Z","body":"Closing as I do not see anything we can do to really simplify user's code."}}