Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Authentication #1

Open
noud opened this issue Sep 18, 2018 · 1 comment
Open

Basic Authentication #1

noud opened this issue Sep 18, 2018 · 1 comment

Comments

@noud
Copy link

noud commented Sep 18, 2018

hi Cosmin,

what i miss is Basic Authentication.
Could be something like:
default: { baseUri: 'https://jsonplaceholder.typicode.com', user: xxxx, password, xxxx }
in the config.

Could you point me, where i should add this in the code?
Then i will give it a try to add and create a pull reuqest.

greetings,
Noud

@cosminseceleanu
Copy link
Owner

Hello Noud,

Sorry for the late response.
I think is best to have something like this:
default:
baseUri: 'https://jsonplaceholder.typicode.com'
baseHeaders:
Authorization: "some auth header"
CustomHeader: "value"

With this approach we could add any HTTP header.
For coding this you need to change Symfony configuration to allow the above model and pass this headers up to Cos\RestClientBundle\Request\RequestExecutor where guzzle is used to execute HTTP request.

https://symfony.com/doc/3.4/components/config/definition.html

Best regards,
Cosmin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants