}
} else if (isOAuthCallback(request)) {
SAMLAuthenticatedPrincipal principal = (SAMLAuthenticatedPrincipal) request.getSession().getAttribute(PRINCIPAL_FROM_SAML);
String authState = (String) request.getSession().getAttribute(RELAY_STATE_FROM_SAML);
if (principal == null) { //huh
throw new ServiceProviderAuthenticationException("No principal anymore in the session");
}
String userId = principal.getName();
if (StringUtils.isEmpty(userId)) {
throw new ServiceProviderAuthenticationException("No userId in SAML assertion!");
}
apiClient.oauthCallback(request, userId);
List<Group20> groups = apiClient.getGroups20(userId, userId);
if (!CollectionUtils.isEmpty(groups)) {
for (Group20 group : groups) {