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

Add support for assets with basic auth #515

Closed
vpetersson opened this issue Nov 23, 2016 · 4 comments
Closed

Add support for assets with basic auth #515

vpetersson opened this issue Nov 23, 2016 · 4 comments
Milestone

Comments

@vpetersson
Copy link
Contributor

Contrary to what we previously thought, UZBL does indeed support Basic Auth. It's just supported through a somewhat odd format where you need to escape the @ (i.e. http://username:password\@domain:port/path. Kudos to @sodabrew for finding out about this. More information about this can be found here.

In order to add this support, we need to add custom handling for this.

  • In the HEAD check (i.e. python request), we might need to parse the credentials and pass them on as follows: requests.head('https://domain/path', auth=HTTPBasicAuth('username', 'password')
  • In the UZBL call, we need to modify the uri we pass on to UZBL as described above (i.e. http://username:password\@domain:port/path).
@vpetersson vpetersson added this to the Sprint 2 milestone Nov 23, 2016
@pain64
Copy link
Contributor

pain64 commented Dec 6, 2016

Where should we get username and password?

@vpetersson
Copy link
Contributor Author

We'd parse it from the URL string, just like most browsers do.

I.e., you'd add an asset with the URL http://username:password@domain:port and we'd parse it from there.

@vpetersson
Copy link
Contributor Author

@over64 I've reopened this issue. @sodabrew raised a valid point in #526.

@farhangithub27
Copy link

We'd parse it from the URL string, just like most browsers do.

I.e., you'd add an asset with the URL http://username:password@domain:port and we'd parse it from there.

Hi @vpetersson , I'm trying to configure web asset with URL format as http://username:password@domain:port
following cases I have used example. I'm trying to land at the home page of my reporting server.

FYI a get request in POSTMAN and firefox browser works fine with standard get request that lands me to the home page of the server. Postman request below is
http://myhost.mydomain:port/reportingserver/flow.html?_flowid=searchFlow&username=myusername&password=mypassword
Also
I have installed uzbl browser on my development system and used URL used for postman
I got logged in successfully through uzbl but it didn't recognize _flowid parameter. So it logged me in but didn't display the home page. I just used mouse and menu bar of the presented page to get to home page.
This means uzbl takes in username and password parameters fine in get request while _flowid was ignored.
So I tried to use this request format in screenly webasset configuration but it throws out same error message:
Server Error: Could not retrieve file. Check the asset URL

Any suggestions how to use your suggested format or anyother to login into my reporting server through screenly web asset.

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

No branches or pull requests

3 participants