Add log messages to troubleshoot OAuth/OpenID linking

Change-Id: Ic8e13eb570d66e144520c29cd65308ce1f1d15c1
This commit is contained in:
David Ostrovsky
2015-03-18 07:54:10 +01:00
committed by Saša Živkov
parent 043c85728a
commit 87b782b16b
2 changed files with 6 additions and 0 deletions

View File

@@ -124,6 +124,7 @@ class OAuthSession {
if (claimedId != null && actualId != null) {
if (claimedId.equals(actualId)) {
// Both link to the same account, that's what we expected.
log.debug("OAuth2: claimed identity equals current id");
} else {
// This is (for now) a fatal error. There are two records
// for what might be the same user.
@@ -138,6 +139,8 @@ class OAuthSession {
} else if (claimedId != null && actualId == null) {
// Claimed account already exists: link to it.
//
log.info("OAuth2: linking claimed identity to {}",
claimedId.toString());
try {
accountManager.link(claimedId, areq);
} catch (OrmException e) {
@@ -148,6 +151,8 @@ class OAuthSession {
return;
}
}
} else {
log.debug("OAuth2: claimed identity is empty");
}
areq.setUserName(user.getUserName());
areq.setEmailAddress(user.getEmailAddress());