oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/endpoint/OAuth2AuthorizationCodeGrantRequestEntityConverter.java
@Override
	public RequestEntity<?> convert(OAuth2AuthorizationCodeGrantRequest authorizationCodeGrantRequest) {
		ClientRegistration clientRegistration = authorizationCodeGrantRequest.getClientRegistration();

		HttpHeaders headers = OAuth2AuthorizationGrantRequestEntityUtils.getTokenRequestHeaders(clientRegistration);
		MultiValueMap<String, String> formParameters = this.buildFormParameters(authorizationCodeGrantRequest);
		URI uri = UriComponentsBuilder.fromUriString(clientRegistration.getProviderDetails().getTokenUri())
				.build()
				.toUri();

		return new RequestEntity<>(formParameters, headers, HttpMethod.POST, uri);
	}
@Override
	public RequestEntity<?> convert(OAuth2AuthorizationCodeGrantRequest authorizationCodeGrantRequest) {
		ClientRegistration clientRegistration = authorizationCodeGrantRequest.getClientRegistration();

		HttpHeaders headers = OAuth2AuthorizationGrantRequestEntityUtils.getTokenRequestHeaders(clientRegistration);
		MultiValueMap<String, String> formParameters = this.buildFormParameters(authorizationCodeGrantRequest);
		URI uri = UriComponentsBuilder.fromUriString(clientRegistration.getProviderDetails().getTokenUri())
				.build()
				.toUri();

		return new RequestEntity<>(formParameters, headers, HttpMethod.POST, uri);
	}
@ Override public RequestEntity < ? > convert ( OAuth2AuthorizationCodeGrantRequest authorizationCodeGrantRequest ) { ClientRegistration clientRegistration = authorizationCodeGrantRequest . getClientRegistration ( ) ; HttpHeaders headers = OAuth2AuthorizationGrantRequestEntityUtils . getTokenRequestHeaders ( clientRegistration ) ; MultiValueMap < String , String > formParameters = this . buildFormParameters ( authorizationCodeGrantRequest ) ; URI uri = UriComponentsBuilder . fromUriString ( clientRegistration . getProviderDetails ( ) . getTokenUri ( ) ) . build ( ) . toUri ( ) ; return new RequestEntity <> ( formParameters , headers , HttpMethod . POST , uri ) ; }
Returns the {@link RequestEntity} used for the Access Token Request.

@param authorizationCodeGrantRequest the authorization code grant request
@return the {@link RequestEntity} used for the Access Token Request
Returns the { @link RequestEntity } used for the Access Token Request .