In the end, I figured it out myself:
You need a custom authenticator
public class MyCustomAuthenticator extends DefaultAuthenticator { protected boolean authenticate(Principal user, String password) throws AuthenticatorException { return true; } protected Principal getUser(String username) { return getCrowdService().getUser(username); } private CrowdService getCrowdService() { return (CrowdService)ComponentManager.getComponent(CrowdService.class); } }
Add MyCustomAuthenticator to seraph-config.xml
<authenticator class="com.company.jira.MyCustomAuthenticator"/>
Write a custom filter to set the username from the http header
public class CustomFilter extends PasswordBasedLoginFilter { @Override protected UserPasswordPair extractUserPasswordPair( HttpServletRequest request) { String username = request.getHeader("iv-header"); if (username != null && username.trim().length() != 0) { return new PasswordBasedLoginFilter.UserPasswordPair( username, "DUMMY", false); } return null; } }
Replace the filter in web.xml
<filter> <filter-name>login</filter-name> <filter-class>com.company.jira.CustomFilter</filter-class> </filter>
These jars are required for Jira 5.2
- submerged crowd api-2.6.2
- JIRA-kernel-5.2.1
- Atlassian-seraph-2.6.0
Tobias sarnow
source share