1 year ago

#386661

test-img

Aparna S

Introspect call to Authorization server from Resource Server fails after second successive calls

Introspect is failing after 2 successive attempts. Error : Introspect endpoint response was invalid,as content-type 'text/html' is not compatible with JSON at org.springframework.security.oauth.server.resource.authentication.OpaqueaTokenAuthenticationProvider.getOAuth2Authenticatedprincple

this is the sample code we are using:

@Override

protected void configure(HttpSecurity http) throws Exception {
    http
      .authorizeRequests(authz -> authz
        .antMatchers(HttpMethod.GET, "/bars/**").hasAuthority("SCOPE_read")
        .antMatchers(HttpMethod.POST, "/bars").hasAuthority("SCOPE_write")
        .anyRequest().authenticated())
      .oauth2ResourceServer(oauth2 -> oauth2
        .opaqueToken(token -> token.introspectionUri(this.introspectionUri)
          .introspectionClientCredentials(this.clientId, this.clientSecret)));
}

java

spring

spring-boot

spring-security

spring-security-oauth2

0 Answers

Your Answer

Accepted video resources