Fixed logging issue; returning null in case principal cannot be determined
This commit is contained in:
parent
9d57eb3655
commit
ef2baa8983
|
|
@ -20,15 +20,16 @@ package org.jasig.cas.client.integration.atlassian;
|
|||
|
||||
import com.atlassian.confluence.user.ConfluenceAuthenticator;
|
||||
import com.atlassian.seraph.auth.AuthenticatorException;
|
||||
import java.security.Principal;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import org.jasig.cas.client.util.AbstractCasFilter;
|
||||
import org.jasig.cas.client.validation.Assertion;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.security.Principal;
|
||||
|
||||
/**
|
||||
* Extension of ConfluenceAuthenticator to allow people to configure Confluence to authenticate
|
||||
* via CAS.
|
||||
|
|
@ -40,7 +41,9 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public final class ConfluenceCasAuthenticator extends ConfluenceAuthenticator {
|
||||
|
||||
/** ConfluenceCasAuthenticator.java */
|
||||
/**
|
||||
* ConfluenceCasAuthenticator.java
|
||||
*/
|
||||
private static final long serialVersionUID = -6097438206488390677L;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ConfluenceCasAuthenticator.class);
|
||||
|
|
@ -61,7 +64,8 @@ public final class ConfluenceCasAuthenticator extends ConfluenceAuthenticator {
|
|||
|
||||
// user doesn't exist
|
||||
if (p == null) {
|
||||
LOGGER.error("Principal is null for ", assertion.getPrincipal().getName());
|
||||
LOGGER.error("Could not determine principal for [{}]", assertion.getPrincipal().getName());
|
||||
return null;
|
||||
}
|
||||
|
||||
LOGGER.debug("Logging in [{}] from CAS.", p.getName());
|
||||
|
|
|
|||
Loading…
Reference in New Issue