因为我是新来的springboot,我被一个senario困住了,请帮帮我。我有一个自定义的登录页面,其中包含用户名和密码并进行验证。如果用户出现在我的数据库中,那么生成jwt令牌,我已经实现了这一点,这个案例正在运行。现在我的问题是
I am trying to integrate the google sign-in. But while integrating the google sign-in, I am
getting authorized as anonymous user and I couldn't able proceed further. This is not the
case I dont want.
when ever user logged with google sign in option user must be able to sign in and could able to
generate the jwt token. How can I solve my problem. I am using technology springboot and reactjs.
我的安全配置代码。
public class Springsec extends WebSecurityConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception{
http
.csrf()
.disable()
.antMatcher("/**")
.authorizeRequests()
.antMatchers("/", "/index.html","/error/**")
.permitAll()
.anyRequest().authenticated().and().formLogin();
/* http
.exceptionHandling()
.authenticationEntryPoint(auth)
.and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http.addFilterBefore(securityFilter, UsernamePasswordAuthenticationFilter.class);
}
}
下面一个是解决我问题的唯一方法还是有解决问题的方法
google sign in must me authorized by reactjs then we have to send access token to the server
and generate the jwt token.
If there is any other way pls help out. If possible send me sample code.
If My guess is the only way to solve the problem, Then simply say yes.
非常感谢。请帮帮我。
1条答案
按热度按时间58wvjzkj1#
我在这里写过。您的配置方法可能类似于:
以及oauth2配置(在application.yaml中):