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

CREST User-supplied details not working #460

Closed
tehFred opened this issue Dec 2, 2015 · 8 comments
Closed

CREST User-supplied details not working #460

tehFred opened this issue Dec 2, 2015 · 8 comments
Labels
fixed This issue has been fixed! Oh joy!

Comments

@tehFred
Copy link

tehFred commented Dec 2, 2015

When I try to add a character, I login and authorize a character, which loads the page saying "Done. Please close this window.", but no characters are added to the CREST Character Management window.

I have tried multiple characters on multiple accounts, and when using implicit mode it worked fine.

@blitzmann
Copy link
Collaborator

  1. Restart pyfa - there is a known issue with switching to user-supplied keys from implicit mode until you restart the process.
  2. Double check the client details (they are probably okay because IIRC CCP will tell you that they are not when trying to login)
  3. Is there anything in your log file (~/.pyfa/log.txt)?
  4. If problem persists, please run pyfa in debug mode (start with the -d flag) and reproduce, and then post logfile (make sure you search for and edit out your secret key if it displays)

Also, what OS are you on?

@tehFred
Copy link
Author

tehFred commented Dec 3, 2015

  1. Restarted pyfa (and my whole machine since yesterdays post), same issue.
  2. I'm assuming the client details are fine given that I'm allowed to login and select a character to use with crest.
  3. log.txt is empty, redoing this with -d
  4. http://pastebin.com/raw.php?i=iUpB0fQV

I am running Windows 8.1 x64

@blitzmann
Copy link
Collaborator

Hi there,

Sorry, been busy with the holidays. I still cannot reproduce, and the pastebin that you provided has expired (I didn't know they did that). Would you mind running again in debug mode and posting the output?

@tehFred
Copy link
Author

tehFred commented Jan 12, 2016

http://pastebin.com/raw/SfRVhfrM

I did the following steps:

Launch pyfa
CREST > Manage Characters
Add Character
Selected character, clicked authorize
"Done. Please close this window." so I close the tab
Back in pyfa, no characters are listed in the character management window, so I quit pyfa and copied the entire contents from ~/.pyfa/log.txt into that pastebin.

While writing these steps I did it again and left pyfa open for longer before closing it (as I was writing this) and now this is at the end of the log file:
2016-01-12 19:21:49,710 service.server DEBUG Server timed out waiting for connection

Just tried it again and got the same entry into the log. It seems to be around a minute before that time-out appears in the log.

Here is a new pastebin with my 3 attempts: http://pastebin.com/raw/D8YY2Aqv

@blitzmann
Copy link
Collaborator

You keep getting a 400 Bad Request status back when trying to authorize your token, and I have no idea why.

Can you perhaps make a new application on the dev site and use the new client details, and test with that?

I will see about making some files with extra debugging that you can add to pyfa to help pinpoint the issue.

@blitzmann
Copy link
Collaborator

Oh, I was able to reproduce. However my error also includes exception information:

2016-01-12 12:23:47,658 requests.packages.urllib3.connectionpool INFO     Starting new HTTPS connection (1): login.eveonline.com
2016-01-12 12:23:48,141 requests.packages.urllib3.connectionpool DEBUG    "POST /oauth/token?code=_zpv-MknspU15vwSrYgcNuzv5gjCTiJrk0-uEkz97_912Xogq275DnhD1sNsDuI00&grant_type=authorization_code HTTP/1.1" 400 64
Traceback (most recent call last):
  File "C:\Users\Ryan\Copy\WinPython-32bit-2.7.10.1\python-2.7.10\lib\site-packages\wx-3.0-msw\wx\_core.py", line 16766, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "C:\Users\Ryan\Copy\Git\blitzmann\Pyfa\service\crest.py", line 203, in handleLogin
    eve.authorize(message['code'][0])
  File "C:\Users\Ryan\Copy\Git\blitzmann\Pyfa\service\pycrest\eve.py", line 243, in authorize
    res = self._authorize(params={"grant_type": "authorization_code", "code": code})
  File "C:\Users\Ryan\Copy\Git\blitzmann\Pyfa\service\pycrest\eve.py", line 231, in _authorize
    raise APIException("Got unexpected status code from API: %i" % res.status_code)
service.pycrest.errors.APIException: Got unexpected status code from API: 400

This is how it's supposed to handle anything that is not a 200 status. I have no idea why yours doesn't do this if it's up to date with latest version...

Anyway, check your client settings and make sure there are no spaces before or after the text in client secret and client id, then retry. If it works, wonderful! I'll make a change to trim the whitespace off when saving it.

@tehFred
Copy link
Author

tehFred commented Jan 13, 2016

I was running 1.17.1. Trimming whitespace I found at the end of the secret has fixed the problem, thanks!

@blitzmann blitzmann added the fixed This issue has been fixed! Oh joy! label Jan 14, 2016
@blitzmann
Copy link
Collaborator

Awesome! There's a new commit that should address this as long as someone re-applies the client details. should ship with next release, whenever that happens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed This issue has been fixed! Oh joy!
Projects
None yet
Development

No branches or pull requests

2 participants