if (status != 303 || locationHeader == null) {
System.out.println("OAuth flow is broken");
}
WebClient authorizeClient = createClient(locationHeader.toString(),
"barry@social.com", "1234");
OAuthAuthorizationData data = authorizeClient.get(OAuthAuthorizationData.class);
Object authenticityCookie = authorizeClient.getResponse().getMetadata().getFirst("Set-Cookie");
Form authorizationResult = getAuthorizationResult(data);
authorizeClient.reset();
authorizeClient.to(data.getReplyTo(), false);
if (authenticityCookie != null) {
authorizeClient.header("Cookie", (String)authenticityCookie);
}
Response r2 = authorizeClient.form(authorizationResult);