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

Fail to login when password has special chars #15

Closed
MatElGran opened this issue May 21, 2018 · 12 comments
Closed

Fail to login when password has special chars #15

MatElGran opened this issue May 21, 2018 · 12 comments

Comments

@MatElGran
Copy link

First, thank you for this, it's going to be extremely valuable to me (reading on an e-reader is so much more comfortable than on a tablet or a phone)

Now, my problem is my passwords are generated, and, as such, contain special chars.

Right now, two of them are giving me problems: : and $

As a workaround, I escaped $ with \, but I had to modify credentials parsing to change the configured separator into a character which does not appear in my password.

May I suggest adding a --sep option, defaulting to :, so that user can choose whatever char suits best ?

As for $, I think it's more of a shell related problem, and I can't see for now a solution to this (other than escaping it, that is). Do you have any idea how we could overcome this ?

I am not fluent in python, but I can probably submit a PR making this separator option change, what do you think ?

@leptoid
Copy link

leptoid commented May 21, 2018

I was going to make a new post, but my error is possibly the same as above. I use an email address for login and a password that ends with a special character (one of these: !@#$%^&*()). When I attempt to use the script, I get the following:

[21/May/2018 06:57:57] ** Welcome to SafariBooks! **
[21/May/2018 06:57:57] Logging into Safari Books Online...
[21/May/2018 06:58:00] Retrieving book info...
[21/May/2018 06:58:01] API: Out-of-Session (Authentication credentials were not provided.).

[21/May/2018 06:58:01] Last request done:
	URL: https://www.safaribooksonline.com/api/v1/book/9780134807553/
	DATA: None
	OTHERS: {}

	401
	Server: nginx/1.10.3 (Ubuntu)
	Content-Type: application/json
	strict-transport-security: max-age=3600; includeSubDomains
	Content-Language: en-US
	WWW-Authenticate: Bearer realm="api"
	Allow: GET, HEAD, OPTIONS
	X-Frame-Options: SAMEORIGIN
	x-content-type-options: nosniff
	x-xss-protection: 1; mode=block
	Set-Cookie: api_key=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/, logged_in=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/, sessionid=n1h1n2qucgwp9sxom4cn3863w9lt8xxk; Domain=.www.safaribooksonline.com; expires=Mon, 04-Jun-2018 11:58:04 GMT; httponly; Max-Age=1209600; Path=/; secure
	Content-Length: 58
	Accept-Ranges: bytes
	Date: Mon, 21 May 2018 11:58:02 GMT
	Via: 1.1 varnish
	Connection: keep-alive
	X-Client-IP: 107.181.176.104
	X-Served-By: cache-atl6236-ATL
	X-Cache: MISS
	X-Cache-Hits: 0
	X-Timer: S1526903882.203840,VS0,VE311
	Vary: Accept, Accept-Language, Authorization, Cookie

{"detail":"Authentication credentials were not provided."}

@lorenzodifuccia
Copy link
Owner

Ok, I'll work on it.

@lorenzodifuccia
Copy link
Owner

Is it correct?

Example

@MatElGran
Copy link
Author

Sorry, I should have give an example: if “[email protected]:pa$$word” is correctly parsed, then it seems good to me

@lorenzodifuccia
Copy link
Owner

Ok, updated.
Let me know if the problem is solved. I'll leave this open until then.

@lorenzodifuccia
Copy link
Owner

No, you know. You have to escape the "$" char: "pa\$\$word"...

@MatElGran
Copy link
Author

That's what I thought, perhaps on note on the README could help future users ? Anyway, thanks for having a look at it

@lorenzodifuccia
Copy link
Owner

Done with a6bbf31
Thank you!

@t0m3kf
Copy link

t0m3kf commented Jan 21, 2019

Hi,

My password includes several special characters, tried escaping all of them but still getting the error

[#] API: Out-of-Session (Authentication credentials were not provided.).

special characters I use: @%^$

Also some of them comes one after the other so double escaping needed %$

Due to some other reasons I cannot change my password easily..

Any advice?

vlqhai pushed a commit to vlqhai/safaribooks that referenced this issue Feb 23, 2020
@narsimuluakula
Copy link

Hi
password has only @ and it is a corporate account. I am unable to login.
Any advise ?

  ____     ___         _     
  / __/__ _/ _/__ _____(_)    
 _\ \/ _ `/ _/ _ `/ __/ /     
/___/\_,_/_/ \_,_/_/ /_/      
  / _ )___  ___  / /__ ___    
 / _  / _ \/ _ \/  '_/(_-<    
/____/\___/\___/_/\_\/___/    
[-] Logging into Safari Books Online...                                                                                  
[#] HTTPSConnectionPool(host='learning.oreilly.com', port=443): Max retries exceeded with url: /login/unified/?next=/home/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10e9c3190>: Failed to establish a new connection: [Errno 60] Operation timed out'))
[#] Login: unable to reach Safari Books Online. Try again...                                                             
[!] Aborting...

@dmcgill50
Copy link

Hi
password has only @ and it is a corporate account. I am unable to login.
Any advise ?

  ____     ___         _     
  / __/__ _/ _/__ _____(_)    
 _\ \/ _ `/ _/ _ `/ __/ /     
/___/\_,_/_/ \_,_/_/ /_/      
  / _ )___  ___  / /__ ___    
 / _  / _ \/ _ \/  '_/(_-<    
/____/\___/\___/_/\_\/___/    
[-] Logging into Safari Books Online...                                                                                  
[#] HTTPSConnectionPool(host='learning.oreilly.com', port=443): Max retries exceeded with url: /login/unified/?next=/home/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10e9c3190>: Failed to establish a new connection: [Errno 60] Operation timed out'))
[#] Login: unable to reach Safari Books Online. Try again...                                                             
[!] Aborting...

I am getting the same behavior. I have removed special characters from my password.

@fengdi721
Copy link

Hi
password has only @ and it is a corporate account. I am unable to login.
Any advise ?

  ____     ___         _     
  / __/__ _/ _/__ _____(_)    
 _\ \/ _ `/ _/ _ `/ __/ /     
/___/\_,_/_/ \_,_/_/ /_/      
  / _ )___  ___  / /__ ___    
 / _  / _ \/ _ \/  '_/(_-<    
/____/\___/\___/_/\_\/___/    
[-] Logging into Safari Books Online...                                                                                  
[#] HTTPSConnectionPool(host='learning.oreilly.com', port=443): Max retries exceeded with url: /login/unified/?next=/home/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10e9c3190>: Failed to establish a new connection: [Errno 60] Operation timed out'))
[#] Login: unable to reach Safari Books Online. Try again...                                                             
[!] Aborting...

I am getting the same behavior. I have removed special characters from my password.

maybe you can try the --login option, which you should type the login/pwd manually.

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

7 participants