lib/auth/types/proxycache/ProxyCache.js
/**
     * Detect authorization header value, either as an http header or as a query parameter
     * @param request
     * @param sessionCredentials
     * @returns {*}
     */
Detect authorization header value, either as an http header or as a query parameter
@param request
@param sessionCredentials
@returns {*}
Detect authorization header value either as an http header or as a query parameter @param request @param sessionCredentials @returns { * }
detectAuthHeaderCredentials(request, sessionCredentials = null) {
        if (sessionCredentials !== null) {
            return null;
        }
        if (request.headers[this.userHeaderName]) {
            const authHeaderValues = {
                [this.userHeaderName]: request.headers[this.userHeaderName],
                'x-forwarded-for': request.headers['x-forwarded-for']
            };
            if (request.headers[this.rolesHeaderName]) {
                authHeaderValues[this.rolesHeaderName] = request.headers[this.rolesHeaderName];
            }
            return authHeaderValues;
        } else if (request.headers[this.authHeaderName]) {
            return {
                [this.authHeaderName]: request.headers[this.authHeaderName]
            }
        }
        return null;
    }
detectAuthHeaderCredentials ( request , sessionCredentials = null ) { if ( sessionCredentials !== null ) { return null ; } if ( request . headers [ this . userHeaderName ] ) { const authHeaderValues = { [ this . userHeaderName ] : request . headers [ this . userHeaderName ] , 'x-forwarded-for' : request . headers [ 'x-forwarded-for' ] } ; if ( request . headers [ this . rolesHeaderName ] ) { authHeaderValues [ this . rolesHeaderName ] = request . headers [ this . rolesHeaderName ] ; } return authHeaderValues ; } else if ( request . headers [ this . authHeaderName ] ) { return { [ this . authHeaderName ] : request . headers [ this . authHeaderName ] } } return null ; }
Detect authorization header value, either as an http header or as a query parameter
 @param request
 @param sessionCredentials
 @returns {*}
Detect authorization header value either as an http header or as a query parameter @param request @param sessionCredentials @returns { * }
// The point of ProxyCache is that we only have headers on the first request. // In other words, if we already have a session, we don't need to check the headers. // The roles header is optional // We still need to support basic auth for Curl etc.