msg.setArgsLocalized(false);
uiApp.addMessage(msg);
}
// Show message about failed social account linking
OAuthException gtnOAuthException = (OAuthException)httpSession.getAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_AFTER_FAILED_LINK);
if (gtnOAuthException != null) {
httpSession.removeAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_AFTER_FAILED_LINK);
Object[] args = new Object[] {gtnOAuthException.getExceptionAttribute(OAuthConstants.EXCEPTION_OAUTH_PROVIDER_USERNAME),
gtnOAuthException.getExceptionAttribute(OAuthConstants.EXCEPTION_OAUTH_PROVIDER_NAME)};
ApplicationMessage appMessage = new ApplicationMessage("UIAccountSocial.msg.failed-link", args, ApplicationMessage.WARNING);
appMessage.setArgsLocalized(false);
uiApp.addMessage(appMessage);
}
// Show message about failed OAuth2 flow
gtnOAuthException = (OAuthException)httpSession.getAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_OAUTH);
if (gtnOAuthException != null) {
httpSession.removeAttribute(OAuthConstants.ATTRIBUTE_EXCEPTION_OAUTH);
String key;
if (gtnOAuthException.getExceptionCode() == OAuthExceptionCode.USER_DENIED_SCOPE) {
key = "UIAccountSocial.msg.access-denied";
} else {
key = "UIAccountSocial.msg.oauth-error";
log.error("Unspecified error during OAuth flow", gtnOAuthException);