Spring Security OAuth2,如何自定义授权代码

问题描述

我要在“授权码授予”中自定义授权码/

我已经看过this(https://www.baeldung.com/spring-security-custom-oauth-requests),它显示了它在oauthlogin(而不是formLogin)中的使用方式。 我正在使用Formlogin,所以我认为它不起作用。 因此,我想知道在formlogin的情况下如何更改响应值。 而且我想更改Auth代码值,也想告诉我如何更改它。

  http.requestMatchers()
                .antMatchers("/login","/logout","/service_spring_security_check","/oauth/authorize","/clients/groups/**","/clients/**","/clients","/api/**","/secret/matches","/auth/defaultToken","/main"
                ).and()
                .authorizeRequests()
                .and()
                .formLogin()
                .loginPage("/login")
                .loginProcessingUrl("/service_spring_security_check")
                .usernameParameter("service_username")
                .passwordParameter("service_password")
                .defaultSuccessUrl("/main")
                .failureHandler(loginFailureHandler)
                .permitAll()
                .and()
                .logout()
                .logoutSuccessHandler(logoutSuccessHandler)
                .logoutSuccessUrl("/login")
                .and().cors().configurationSource(configurationSource())
                .and().csrf().disable();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...