Search code examples
spring-securityspring-cloudnetflix-zuul

Basic Authentication service called By Zuul


I'm Zuul as edge server. so all request pass by this edge server. I have a micro-service A. all web services of A are protected by Basic Authentication. How can we call the services of A b passing by Zuul proxy? Should I add header for messages?


Solution

  • Ideally the requester would have the token in the request.
    If you want to have Zuul add the authentication token then you can create a ZuulFilter and use:

    context.addZuulRequestHeader("Authorization", "base64encodedTokenHere");
    

    Doing this would give open access to the services - which may not be wise.