Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/com/lastpass/confluence/SAMLAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,17 @@ public Principal getUser(HttpServletRequest request,
logger.error("Unable to create new user: " + username);
return null;
}

try {
Group group = userAccessor.getGroup(UserAccessor.GROUP_CONFLUENCE_USERS);
if (group != null) {
GroupManager groupManager = (GroupManager)
ContainerManager.getComponent("groupManager");
groupManager.addMembership(group, user);
if (! email.endsWith('@surevine.com') ) {
try {
Group group = userAccessor.getGroup(UserAccessor.GROUP_CONFLUENCE_USERS);
if (group != null) {
GroupManager groupManager = (GroupManager)
ContainerManager.getComponent("groupManager");
groupManager.addMembership(group, user);
}
} catch (EntityException e) {
logger.error("Unable to add new user to group, continuing...");
}
} catch (EntityException e) {
logger.error("Unable to add new user to group, continuing...");
}
}

Expand Down
3 changes: 2 additions & 1 deletion web/saml_login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
--
--%>
<%@ page import="com.lastpass.confluence.SAMLAuthenticator" %>
<% String context = request.getContextPath(); %>
<%
// This page is accessed to initiate SAML login when getUser() in the
// authenticator returns null and there is no SAMLResponse being processed.
// Confluence will go here when we click on a login link (based on seraph config).
//
// We generate an authnrequest and then redirect to the IdP.
try {
String url = new SAMLAuthenticator().getRedirectUrl(request.getParameter("os_destination"));
String url = new SAMLAuthenticator().getRedirectUrl(context + request.getParameter("os_destination"));
response.sendRedirect(response.encodeRedirectURL(url));
} catch (Throwable t) {
out.println("Could not initialize Confluence SAML plugin: " + t);
Expand Down