amenezes / config-client

config-client package for spring cloud config and cloud foundry
https://config-client.amenezes.net/
Apache License 2.0
24 stars 17 forks source link

How to invoke config server using basic authentication #40

Closed rmotapar closed 3 years ago

rmotapar commented 3 years ago

Hi, Our spring config server is protected using basic authentication. Is it possible to use config-client to send a basic auth header with the request? If yes, an example would be very helpful.

Thanks!

amenezes commented 3 years ago

@rmotapar,

Yes it's possible. Try use HTTPBasicAuth.

For example:

from requests.auth import HTTPBasicAuth

from config.spring import ConfigClient

client = ConfigClient(app_name="simpleweb000")
client.get_config(auth=HTTPBasicAuth('user', password))

I will update the project documentation with this question.

Thanks.

amenezes commented 3 years ago

@rmotapar the example solved your question?

The project documentation was been updated.

rmotapar commented 3 years ago

@amenezes Thank you so much for the quick response. I have verified this using your example and it's working!