in src/main/java/com/googlesource/gerrit/plugins/saml/SamlWebFilter.java [185:211]
private void signin(J2EContext context) throws HttpAction, IOException {
SAML2Credentials credentials = saml2Client.getCredentials(context);
SAML2Profile user = saml2Client.getUserProfile(credentials, context);
if (user != null) {
log.debug(
"Received SAML callback for userId={} with attributes: {}",
getUserName(user),
user.getAttributes());
HttpSession s = context.getRequest().getSession();
AuthenticatedUser authenticatedUser =
new AuthenticatedUser(
getUserName(user),
getDisplayName(user),
getEmailAddress(user),
String.format("%s/%s", SAML, user.getId()));
s.setAttribute(SESSION_ATTR_USER, authenticatedUser);
if (samlMembership.isEnabled()) {
samlMembership.sync(authenticatedUser, user);
}
String redirectUri = context.getRequest().getParameter("RelayState");
if (null == redirectUri || redirectUri.isEmpty()) {
redirectUri = "/";
}
context.getResponse().sendRedirect(context.getRequest().getContextPath() + redirectUri);
}
}