I'd like to override spring's default AuthorizationEndpoint
and provide my own on /oauth/authorize
. I wrote my own controller
@RestController
@RequestMapping("oauth/authorize")
public class AuthorizationController {
@RequestMapping
public void authorize(@RequestParam Map<String, String> parameters, HttpServletResponse response) throws Exception {
// todo
}
}
However it is not mapped as AuthorizationEndpoint
maps to /oauth/authorize
by default. How can I remove the standard implementation?
Bonus
The reason I want to provide my own implementation is because my rest api is stateless and does not provide sessions and/or web interface, standalone angular app does that for me and authorizes using passwrd grant to server. So what I want to do is redirect the user to my angular app's approoval page and implement a custom user_oauth_approval
approveOrDeny endpoint which my client calls. I'm not sure if I can set that up with spring, and even if I could, custom implementation would probably be less hassle. I'd love to hear some insights