}
return oauthOperations.fetchRequestToken(null, requestParameters);
}
private String buildOAuth2Url(OAuth2ConnectionFactory<?> connectionFactory, NativeWebRequest request, MultiValueMap<String, String> additionalParameters) {
OAuth2Operations oauthOperations = connectionFactory.getOAuthOperations();
String defaultScope = connectionFactory.getScope();
OAuth2Parameters parameters = getOAuth2Parameters(request, defaultScope, additionalParameters);
String state = connectionFactory.generateState();
parameters.add("state", state);
sessionStrategy.setAttribute(request, OAUTH2_STATE_ATTRIBUTE, state);
if (useAuthenticateUrl) {
return oauthOperations.buildAuthenticateUrl(parameters);
} else {
return oauthOperations.buildAuthorizeUrl(parameters);
}
}