Spring OAuth2 - custom “OAuth Approval” page at oauth/authorize

前端 未结 3 1895
轻奢々
轻奢々 2020-12-25 15:05

what is recommended way to create custom pages OAuth Approval page:

\"default

I have to completely o

3条回答
  •  梦谈多话
    2020-12-25 15:53

    Implement your class with WebMvcConfigurer and override

    void addViewControllers(ViewControllerRegistry registry) method

    @SpringBootApplication
    @EnableAuthorizationServer
    public class AuthServerApplication implements WebMvcConfigurer {
    
        public static void main(String[] args) {
            SpringApplication.run(AuthServerApplication.class, args);
        }
    
        @Override
        public void addViewControllers(ViewControllerRegistry registry) {
            registry.addViewController("/oauth/confirm_access").setViewName("AuthorizationPage");
        }
    }
    

    here AuthorizationPage is the html page you've created.

提交回复
热议问题