summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-01-27 14:36:48 -0800
committerShawn O. Pearce <sop@google.com>2009-01-27 14:40:24 -0800
commitf04ff6b5047d1ff574827e51135efd13959e518c (patch)
tree23db140e25fc869497308fa43df72f55a7f53926
parent8126248c7b25bbf7a2efeb91440c42dbfc0618a2 (diff)
Honor the claimed identity, not the delegate
Users who login with a delegate OpenID want to record their claimed identity, not their delegate identity. Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--appjar/src/main/java/com/google/gerrit/server/OpenIdLoginServlet.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/appjar/src/main/java/com/google/gerrit/server/OpenIdLoginServlet.java b/appjar/src/main/java/com/google/gerrit/server/OpenIdLoginServlet.java
index a33e7ce67e..91f1bd257a 100644
--- a/appjar/src/main/java/com/google/gerrit/server/OpenIdLoginServlet.java
+++ b/appjar/src/main/java/com/google/gerrit/server/OpenIdLoginServlet.java
@@ -299,7 +299,7 @@ public class OpenIdLoginServlet extends HttpServlet {
save(me, req, OpenIdUtil.P_SIGNIN_CB);
save(me, req, OpenIdUtil.P_SIGNIN_MODE);
if ("on".equals(req.getParameter(OpenIdUtil.P_REMEMBERID))) {
- final String ident = saveLastId(req, rsp, user.getIdentity());
+ final String ident = saveLastId(req, rsp, user.getClaimedId());
me.put(OpenIdUtil.LASTID_COOKIE, ident);
save(me, req, OpenIdUtil.P_REMEMBERID);
} else {
@@ -325,7 +325,7 @@ public class OpenIdLoginServlet extends HttpServlet {
final String fullname, final String email) throws OrmException {
Account account;
final AccountExternalIdAccess extAccess = db.accountExternalIds();
- AccountExternalId acctExt = lookup(extAccess, user.getIdentity());
+ AccountExternalId acctExt = lookup(extAccess, user.getClaimedId());
if (acctExt == null && email != null
&& server.isAllowGoogleAccountUpgrade() && isGoogleAccount(user)) {
@@ -335,7 +335,7 @@ public class OpenIdLoginServlet extends HttpServlet {
//
final AccountExternalId openidExt =
new AccountExternalId(new AccountExternalId.Key(acctExt
- .getAccountId(), user.getIdentity()));
+ .getAccountId(), user.getClaimedId()));
extAccess.insert(Collections.singleton(openidExt));
acctExt = openidExt;
}
@@ -365,7 +365,7 @@ public class OpenIdLoginServlet extends HttpServlet {
acctExt =
new AccountExternalId(new AccountExternalId.Key(account.getId(), user
- .getIdentity()));
+ .getClaimedId()));
acctExt.setLastUsedOn();
acctExt.setEmailAddress(email);
@@ -410,7 +410,7 @@ public class OpenIdLoginServlet extends HttpServlet {
}
final AccountExternalId.Key idKey =
- new AccountExternalId.Key(account.getId(), user.getIdentity());
+ new AccountExternalId.Key(account.getId(), user.getClaimedId());
AccountExternalId id = db.accountExternalIds().get(idKey);
if (id == null) {
id = new AccountExternalId(idKey);
@@ -454,7 +454,7 @@ public class OpenIdLoginServlet extends HttpServlet {
}
private static boolean isGoogleAccount(final OpenIdUser user) {
- return user.getIdentity().startsWith(OpenIdUtil.URL_GOOGLE + "?");
+ return user.getClaimedId().startsWith(OpenIdUtil.URL_GOOGLE + "?");
}
private static AccountExternalId lookupGoogleAccount(