0

I currently have spring security added to my web app and looks like below:

public class SecurityConfig extends WebSecurityConfigurerAdapter {
public void copnfigure(HttpSecurity httpSecurity) throws Exception{
    httpSecurity.authorizeRequests().antMatchers("/**").hasRole("USER")
    .and()
    .formLogin().loginPage("login.html").permitAll();





}

@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth
        .inMemoryAuthentication()
            .withUser("username").password("password123").roles("USER")
            .and()
            .withUser("adminname").password("password123").roles("USER","ADMIN");
}

}

Instead of spring security I would like to have oauth2 security(with token).But how to change this one to oauth2 security.Any help is appreciated

0 Answers0