{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/15806","labels_url":"https://api.github.com/repos/symfony/symfony/issues/15806/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15806/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/15806/events","html_url":"https://github.com/symfony/symfony/issues/15806","id":106562781,"number":15806,"title":"[Security] Retrieving the authentication manager for the current security token","user":{"login":"felicitus","id":162974,"avatar_url":"https://avatars.githubusercontent.com/u/162974?v=3","gravatar_id":"","url":"https://api.github.com/users/felicitus","html_url":"https://github.com/felicitus","followers_url":"https://api.github.com/users/felicitus/followers","following_url":"https://api.github.com/users/felicitus/following{/other_user}","gists_url":"https://api.github.com/users/felicitus/gists{/gist_id}","starred_url":"https://api.github.com/users/felicitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felicitus/subscriptions","organizations_url":"https://api.github.com/users/felicitus/orgs","repos_url":"https://api.github.com/users/felicitus/repos","events_url":"https://api.github.com/users/felicitus/events{/privacy}","received_events_url":"https://api.github.com/users/felicitus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Security","name":"Security","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-15T14:00:57Z","updated_at":"2015-09-30T13:17:49Z","closed_at":null,"body":"I need to find out which authentication provider was responsible for authenticating the security token.\r\n\r\nRight now there seems to be no way to retrieve the authentication provider for the current security token.\r\n\r\nUse case:\r\n\r\n- An API has various authentication variants (LDAP, WSSE Token, FOSUser, HTTP Basic)\r\n- Because it may happen that the same username exists, but may be assigned to different providers, a developer needs to be able to distinguish between the different authentication variants\r\n- The `TokenInterface` does not allow us to find out with which authentication provider the token was generated\r\n- The `AuthenticationProviderManager` does not allow us to check which token was generated by which authentication provider\r\n\r\nI propose to modify the `AuthenticationProviderManager` to store the `AuthenticationProviderInterface` so that a developer can retrieve the `AuthenticationProviderInterface` via a call to `AuthenticationProviderManager->getProviderForToken(TokenInterface $token)`.\r\n\r\nAnother implementation, which may not be BC compatible, would be to extend `TokenInterface` so that it includes the `AuthenticationProviderInterface`."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/144391981","html_url":"https://github.com/symfony/symfony/issues/15806#issuecomment-144391981","issue_url":"https://api.github.com/repos/symfony/symfony/issues/15806","id":144391981,"user":{"login":"felicitus","id":162974,"avatar_url":"https://avatars.githubusercontent.com/u/162974?v=3","gravatar_id":"","url":"https://api.github.com/users/felicitus","html_url":"https://github.com/felicitus","followers_url":"https://api.github.com/users/felicitus/followers","following_url":"https://api.github.com/users/felicitus/following{/other_user}","gists_url":"https://api.github.com/users/felicitus/gists{/gist_id}","starred_url":"https://api.github.com/users/felicitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felicitus/subscriptions","organizations_url":"https://api.github.com/users/felicitus/orgs","repos_url":"https://api.github.com/users/felicitus/repos","events_url":"https://api.github.com/users/felicitus/events{/privacy}","received_events_url":"https://api.github.com/users/felicitus/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T13:17:49Z","updated_at":"2015-09-30T13:17:49Z","body":"@jakzal this is important because different authentication providers require additional handling for example: Different logout implementations. "}}