use of io.github.tesla.authz.controller.oauth2.token.OAuthTokenHandleDispatcher in project tesla by linking12.
the class OauthTokenController method authorize.
@RequestMapping("token")
public void authorize(HttpServletRequest request, HttpServletResponse response) throws OAuthSystemException {
try {
OAuthTokenxRequest tokenRequest = new OAuthTokenxRequest(request);
OAuthTokenHandleDispatcher tokenHandleDispatcher = new OAuthTokenHandleDispatcher(tokenRequest, response);
tokenHandleDispatcher.dispatch();
} catch (OAuthProblemException e) {
LOG.debug(e.getMessage(), e);
OAuthResponse oAuthResponse = OAuthASResponse.errorResponse(HttpServletResponse.SC_FOUND).location(e.getRedirectUri()).error(e).buildJSONMessage();
WebUtils.writeOAuthJsonResponse(response, oAuthResponse);
}
}
Aggregations