Spring Boot-based Microservice: running a Route as a service provider with HTTP Basic Authentication

Question

How do I run a Spring Boot Route with a cCXF provider secured with HTTP Basic Authentication?

 

Answer

If a Route is a web service provider, and Authentication with HTTP Basic is enabled on the cCXF component, then specify the user/password to be used when calling this service with the Spring Boot parameters security.user.name and security.user.password.

java -jar ArchiveFileName.jar --security.user.name=USERNAME --security.user.password=PASSWORD

For example:

java -jar myServiceRoute_0.1.jar --security.user.name=myUser1 --security.user.password=secret

 

Note:

  • Ensure the "Address" of the cCXF provider is set with a relative path, not a full HTTP URL (for example /testMe).

     

  • When calling the service, add /services/ to the HTTP URL, for example:

    http://localhost:8065/services/testMe
Version history
Revision #:
5 of 5
Last update:
‎10-11-2017 10:55 AM
Updated by:
 
Labels (3)
Contributors
Tags (1)