@@ -0,0 +1,1533 @@
+package digital.loom.rhizome.authentication;%0A%0Aimport java.util.regex.Pattern;%0A%0Aimport javax.servlet.http.Cookie;%0Aimport javax.servlet.http.HttpServletRequest;%0A%0Aimport com.auth0.jwt.internal.org.apache.commons.lang3.StringUtils;%0Aimport com.auth0.spring.security.api.Auth0AuthenticationFilter;%0Aimport com.google.common.base.MoreObjects;%0A%0Apublic class CookieReadingAuth0AuthenticationFilter extends Auth0AuthenticationFilter %7B%0A    @Override%0A    protected String getToken( HttpServletRequest httpRequest ) %7B%0A        String authorizationCookie = null;%0A%0A        for ( Cookie cookie : httpRequest.getCookies() ) %7B%0A            if ( StringUtils.equals( cookie.getName(), %22authorization%22 ) ) %7B%0A                authorizationCookie = cookie.getValue();%0A                break;%0A            %7D%0A        %7D%0A%0A        final String authorizationHeader = httpRequest.getHeader( %22authorization%22 );%0A        if ( authorizationHeader == null ) %7B%0A            // %22Unauthorized: No Authorization header was found%22%0A            return null;%0A        %7D%0A        final String%5B%5D parts = MoreObjects.firstNonNull( authorizationHeader, authorizationCookie ).split( %22 %22 );%0A        if ( parts.length != 2 ) %7B%0A            // %22Unauthorized: Format is Authorization: Bearer %5Btoken%5D%22%0A            return null;%0A        %7D%0A        final String scheme = parts%5B 0 %5D;%0A        final String credentials = parts%5B 1 %5D;%0A        final Pattern pattern = Pattern.compile( %22%5EBearer$%22, Pattern.CASE_INSENSITIVE );%0A        return pattern.matcher( scheme ).matches() ? credentials : null;%0A    %7D%0A%7D%0A

Add missing file