add(new PopupCloseLink<String>("close"));
add(new Label("oAuthResultLabel", notStarted));
}
public OAuthPage(PageParameters pp) throws Exception {
OAuthData oauth = OAuthPageFactory.getOAuthObject(getSession().getId());
if (oauth != null) {
String intermediate = oauth.getIntermediateParameterName();
if (!pp.get(intermediate).isEmpty()) {
String code = pp.get(intermediate).toOptionalString();
OAuthData data = OAuthPageFactory.getOAuthObject(getSession().getId());
data.addEntryToSecondParams(intermediate, code);
String accessToken = performOAuthValidation(new URL(data.generateSecondCallLink()));
OAuthPageFactory.removeOAuthObject(getSession().getId());
String successful = new StringResourceModel("oAuth.Successful", this, null).getString();
add(new Label("oAuthResultLabel", successful + accessToken));
add(new PopupCloseLink<String>("close"));