The official sample Spring Authorization Server returns an access_token and id_token by default for Oauth 2.1 with PKCE
Is it possible that the endpoint /oauth2/token also returns a refresh_token in the response? What changes or configuration would I need in the sample for getting a refresh_token?
Here's a Postman request for the token
I will also mention a few changes I had to make for Code Flow with PKCE
Disabled CSRF
http
.authorizeRequests(authorizeRequests ->
authorizeRequests.anyRequest().authenticated()
)
.formLogin(withDefaults())
.csrf().disable();
Changed ClientAuthenticationMethod.CLIENT_SECRET_BASIC to ClientAuthenticationMethod.NONE
Changed requireAuthorizationConsent(true) to requireProofKey(true)