{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/582","labels_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/582/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/582/comments","events_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/582/events","html_url":"https://github.com/spring-projects/spring-security-oauth/issues/582","id":108731425,"number":582,"title":"How to change the error response for TokenEndpoint?","user":{"login":"miguelchico","id":6106661,"avatar_url":"https://avatars.githubusercontent.com/u/6106661?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelchico","html_url":"https://github.com/miguelchico","followers_url":"https://api.github.com/users/miguelchico/followers","following_url":"https://api.github.com/users/miguelchico/following{/other_user}","gists_url":"https://api.github.com/users/miguelchico/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelchico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelchico/subscriptions","organizations_url":"https://api.github.com/users/miguelchico/orgs","repos_url":"https://api.github.com/users/miguelchico/repos","events_url":"https://api.github.com/users/miguelchico/events{/privacy}","received_events_url":"https://api.github.com/users/miguelchico/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-09-28T19:38:23Z","updated_at":"2016-01-08T17:17:22Z","closed_at":null,"body":"Hi all!!\r\n\r\nI have a question regarding the TokenEndpoint response error.\r\nI´m trying to unify all error responses for my application but I can´t override the error response for TokenEndpoint.\r\n\r\nThe response I´m looking for is completly different than the actual sent by the TokenEndpoint. I want something like:\r\n```\r\n{\r\n  \"status\": \"UNAUTHORIZED\",\r\n  \"code\": 40102,\r\n  \"message\": \"Invalid Grant\",\r\n  \"path\": \"/oauth/token\",\r\n}\r\n````\r\n\r\nbut I can´t obtain that response using the exceptionTranslator because the response shoud be a OAuth2Exception and I can´t include these fields inside OAuth2Exception.\r\n\r\nDo you have any suggestion?"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/comments/170062206","html_url":"https://github.com/spring-projects/spring-security-oauth/issues/582#issuecomment-170062206","issue_url":"https://api.github.com/repos/spring-projects/spring-security-oauth/issues/582","id":170062206,"user":{"login":"SlimeQ","id":3934698,"avatar_url":"https://avatars.githubusercontent.com/u/3934698?v=3","gravatar_id":"","url":"https://api.github.com/users/SlimeQ","html_url":"https://github.com/SlimeQ","followers_url":"https://api.github.com/users/SlimeQ/followers","following_url":"https://api.github.com/users/SlimeQ/following{/other_user}","gists_url":"https://api.github.com/users/SlimeQ/gists{/gist_id}","starred_url":"https://api.github.com/users/SlimeQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SlimeQ/subscriptions","organizations_url":"https://api.github.com/users/SlimeQ/orgs","repos_url":"https://api.github.com/users/SlimeQ/repos","events_url":"https://api.github.com/users/SlimeQ/events{/privacy}","received_events_url":"https://api.github.com/users/SlimeQ/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T17:17:22Z","updated_at":"2016-01-08T17:17:22Z","body":"is your DefaultWebResponseExceptionTranslator class in the proper package like `package org.springframework.security.oauth2.provider.error;`? if it's in the same package as the old one the framework will pick it up with no config needed."}}