resourceserver1/src/main/java/com/sushmita/github/spring_security_oauth/springsecurityoauth/config/SpringWebSecurityConfig.java
// it will extract the jwt token and check its
it will extract the jwt token and check its
it will extract the jwt token and check its
protected void configure(HttpSecurity http) throws Exception {
        JwtAuthenticationConverter jwtAuthenticationConverter = new JwtAuthenticationConverter();
        SecurityRoleConverter roleConverter = new SecurityRoleConverter();
        jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(roleConverter);
        http.authorizeRequests()
                .antMatchers(HttpMethod.GET,"/token").hasAuthority(PROFILE_SCOPE)
                .antMatchers(HttpMethod.GET,"/status").hasRole(ROLE)
                .anyRequest().authenticated()
                .and()
                .oauth2ResourceServer()
                .jwt()
                .jwtAuthenticationConverter(jwtAuthenticationConverter);
    }
protected void configure ( HttpSecurity http ) throws Exception { JwtAuthenticationConverter jwtAuthenticationConverter = new JwtAuthenticationConverter ( ) ; SecurityRoleConverter roleConverter = new SecurityRoleConverter ( ) ; jwtAuthenticationConverter . setJwtGrantedAuthoritiesConverter ( roleConverter ) ; http . authorizeRequests ( ) . antMatchers ( HttpMethod . GET , "/token" ) . hasAuthority ( PROFILE_SCOPE ) . antMatchers ( HttpMethod . GET , "/status" ) . hasRole ( ROLE ) . anyRequest ( ) . authenticated ( ) . and ( ) . oauth2ResourceServer ( ) . jwt ( ) . jwtAuthenticationConverter ( jwtAuthenticationConverter ) ; }
it will extract the jwt token and check its
it will extract the jwt token and check its