{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/358","labels_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/358/comments","events_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/358/events","html_url":"https://github.com/spring-projects/spring-security-oauth/issues/358","id":54074244,"number":358,"title":"Better JWT Support with a UserAuthenticationConverter Supporting UserDetailsService","user":{"login":"mrcritical","id":550675,"avatar_url":"https://avatars.githubusercontent.com/u/550675?v=3","gravatar_id":"","url":"https://api.github.com/users/mrcritical","html_url":"https://github.com/mrcritical","followers_url":"https://api.github.com/users/mrcritical/followers","following_url":"https://api.github.com/users/mrcritical/following{/other_user}","gists_url":"https://api.github.com/users/mrcritical/gists{/gist_id}","starred_url":"https://api.github.com/users/mrcritical/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrcritical/subscriptions","organizations_url":"https://api.github.com/users/mrcritical/orgs","repos_url":"https://api.github.com/users/mrcritical/repos","events_url":"https://api.github.com/users/mrcritical/events{/privacy}","received_events_url":"https://api.github.com/users/mrcritical/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-security-oauth/labels/New%20Feature","name":"New Feature","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/spring-projects/spring-security-oauth/milestones/11","labels_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/milestones/11/labels","id":907086,"number":11,"title":"2.0.6","description":"","creator":{"login":"dsyer","id":124075,"avatar_url":"https://avatars.githubusercontent.com/u/124075?v=3","gravatar_id":"","url":"https://api.github.com/users/dsyer","html_url":"https://github.com/dsyer","followers_url":"https://api.github.com/users/dsyer/followers","following_url":"https://api.github.com/users/dsyer/following{/other_user}","gists_url":"https://api.github.com/users/dsyer/gists{/gist_id}","starred_url":"https://api.github.com/users/dsyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsyer/subscriptions","organizations_url":"https://api.github.com/users/dsyer/orgs","repos_url":"https://api.github.com/users/dsyer/repos","events_url":"https://api.github.com/users/dsyer/events{/privacy}","received_events_url":"https://api.github.com/users/dsyer/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":8,"state":"open","created_at":"2014-12-17T14:54:11Z","updated_at":"2015-01-26T09:46:10Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-01-12T16:29:08Z","updated_at":"2015-01-26T09:46:10Z","closed_at":"2015-01-26T09:46:10Z","body":"I was having a lot of problems trying to switch from the ```InMemoryTokenStore``` to the ```JWTTokenStore``` while using the ```@AuthenticationPrincipal``` annotation for injecting the principal. The in-memory would inject the ```UserDetails```, as expected, while the JWT store only injected the username. \r\n\r\nI finally figured out how to fix this. It involved implementing a ```UserAuthenticationConverter``` that uses the ```UserDetailsService``` in the ```UserAuthenticationConverter#extractAuthentication``` method.  It seems like this should be an option included in Spring OAuth to me. In addition to the existing ```DefaultUserAuthenticationConverter```.\r\n\r\nAlso, to make it work like the ```DefaultUserAuthenticationConverter``` I had to replicate the ```DefaultUserAuthenticationConverter#getAuthorities()``` method. It is currently marked as private. Can I also suggest changing the visibility to ```protected``` and expose the ```defaultAuthorities```. That makes it much easier to subclass ```DefaultUserAuthenticationConverter``` if necessary."}}