addons/httprox/common/src/main/java/org/commonjava/indy/httprox/keycloak/KeycloakProxyAuthenticator.java
protected void sendChallengeResponse( HttpWrapper http, String error, String description )
            throws IOException
    {
        StringBuilder header = new StringBuilder( String.format( PROXY_AUTHENTICATE_FORMAT,
                                                                 httproxConfig.getProxyRealm() ) );
        if ( error != null )
        {
            header.append( ", error=\"" ).append( error ).append( "\"" );
        }
        if ( description != null )
        {
            header.append( ", error_description=\"" ).append( description ).append( "\"" );
        }

        final String challenge = header.toString();

        ApplicationStatus stat = ApplicationStatus.PROXY_AUTHENTICATION_REQUIRED;
        http.writeStatus( stat.code(), stat.message() );
        http.writeHeader( ApplicationHeader.proxy_authenticate, challenge );
    }
protected void sendChallengeResponse( HttpWrapper http, String error, String description )
            throws IOException
    {
        StringBuilder header = new StringBuilder( String.format( PROXY_AUTHENTICATE_FORMAT,
                                                                 httproxConfig.getProxyRealm() ) );
        if ( error != null )
        {
            header.append( ", error=\"" ).append( error ).append( "\"" );
        }
        if ( description != null )
        {
            header.append( ", error_description=\"" ).append( description ).append( "\"" );
        }

        final String challenge = header.toString();

        ApplicationStatus stat = ApplicationStatus.PROXY_AUTHENTICATION_REQUIRED;
        http.writeStatus( stat.code(), stat.message() );
        http.writeHeader( ApplicationHeader.proxy_authenticate, challenge );
    }
}