Add log messages to troubleshoot OAuth/OpenID linking
Change-Id: Ic8e13eb570d66e144520c29cd65308ce1f1d15c1
This commit is contained in:
committed by
Saša Živkov
parent
043c85728a
commit
87b782b16b
@@ -124,6 +124,7 @@ class OAuthSession {
|
|||||||
if (claimedId != null && actualId != null) {
|
if (claimedId != null && actualId != null) {
|
||||||
if (claimedId.equals(actualId)) {
|
if (claimedId.equals(actualId)) {
|
||||||
// Both link to the same account, that's what we expected.
|
// Both link to the same account, that's what we expected.
|
||||||
|
log.debug("OAuth2: claimed identity equals current id");
|
||||||
} else {
|
} else {
|
||||||
// This is (for now) a fatal error. There are two records
|
// This is (for now) a fatal error. There are two records
|
||||||
// for what might be the same user.
|
// for what might be the same user.
|
||||||
@@ -138,6 +139,8 @@ class OAuthSession {
|
|||||||
} else if (claimedId != null && actualId == null) {
|
} else if (claimedId != null && actualId == null) {
|
||||||
// Claimed account already exists: link to it.
|
// Claimed account already exists: link to it.
|
||||||
//
|
//
|
||||||
|
log.info("OAuth2: linking claimed identity to {}",
|
||||||
|
claimedId.toString());
|
||||||
try {
|
try {
|
||||||
accountManager.link(claimedId, areq);
|
accountManager.link(claimedId, areq);
|
||||||
} catch (OrmException e) {
|
} catch (OrmException e) {
|
||||||
@@ -148,6 +151,8 @@ class OAuthSession {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.debug("OAuth2: claimed identity is empty");
|
||||||
}
|
}
|
||||||
areq.setUserName(user.getUserName());
|
areq.setUserName(user.getUserName());
|
||||||
areq.setEmailAddress(user.getEmailAddress());
|
areq.setEmailAddress(user.getEmailAddress());
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ class OpenIdServiceImpl {
|
|||||||
final AuthRequest aReq;
|
final AuthRequest aReq;
|
||||||
try {
|
try {
|
||||||
aReq = manager.authenticate(state.discovered, state.retTo.toString());
|
aReq = manager.authenticate(state.discovered, state.retTo.toString());
|
||||||
|
log.debug("OpenID: openid-realm={}", state.contextUrl);
|
||||||
aReq.setRealm(state.contextUrl);
|
aReq.setRealm(state.contextUrl);
|
||||||
|
|
||||||
if (requestRegistration(aReq)) {
|
if (requestRegistration(aReq)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user