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

http module basic auth feature #21

Closed
anandsunderraman opened this issue Sep 4, 2019 · 1 comment
Closed

http module basic auth feature #21

anandsunderraman opened this issue Sep 4, 2019 · 1 comment

Comments

@anandsunderraman
Copy link

Does http module support basic auth feature.

I was looking for a way to do basic authentication with REST api.
I am not able to see a way to do it in docs.
The other option would be to write an external step that creates the Base64 encoding and then use that in the http step for the headers

@comtihon
Copy link
Owner

comtihon commented Sep 5, 2019

Yeah, there is no basic auth option externalized, but you can do it by passing a custom Authorization header with Basic <base64>
You can try to use Jinja2 base64 encoding:

http: 
    post: 
         url: 'http://test.com'
         body: {'id': '{{ id }}', 'action': 'fee'}
         headers: {Authorization: 'Basic {{ username + ':' + password | b64encode }}'}

@comtihon comtihon closed this as completed Oct 3, 2019
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