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

Gravatar XML-RPC authentication #7

Closed
JonBunator opened this issue Mar 31, 2021 · 5 comments
Closed

Gravatar XML-RPC authentication #7

JonBunator opened this issue Mar 31, 2021 · 5 comments

Comments

@JonBunator
Copy link

I tried the sample code in the docs with my credentials:

from libgravatar import GravatarXMLRPC
g = GravatarXMLRPC('user@domain', apikey='1234')
g.test() # test the API

But unfortunally I always get a bad authentication error: Server error: Invalid Email, or Hash, or Access Denied (error code: -9)
The apikey is available at https://apikey.wordpress.com/ right?
If anyone has any idea what the problem could be I would really appreciate it :)

@pabluk
Copy link
Owner

pabluk commented Mar 31, 2021

Hi @JonBunator,

I've just gave a try to this, that page https://apikey.wordpress.com/ gives you the good API key, but it also shows the username and you need instead to pass to the function the email address associated to your account.

This was my test (I replaced my API key and user info):

from libgravatar import GravatarXMLRPC
g = GravatarXMLRPC('username', apikey='1234') # as showed at https://apikey.wordpress.com/
g.test()
Server error: Invalid Email, or Hash, or Access Denied (error code: -9)

and using the API key and an email address:

from libgravatar import GravatarXMLRPC
g = GravatarXMLRPC('user@example.com', apikey='1234') # my email address and
                                                      # only the API key from https://apikey.wordpress.com/
g.test()
{'response': 1617224812}

Let me know if that fix your issue in order to update the documentation, and thanks for reporting it.

@JonBunator
Copy link
Author

Thanks for the quick response! I have already used the associated email. Still not working :/ But thank you for trying it out. It has to be some issue with my account then.

@pabluk
Copy link
Owner

pabluk commented Apr 1, 2021

No problem @JonBunator, I'll update the documentation to clarify that point and the information provided at https://apikey.wordpress.com/. Thank you for your help.

@RokeJulianLockhart
Copy link

@JonBunator, if I pass the credentials as strings, it authenticates, but not if I pass them via variables. Perhaps that's your issue too?

@JonBunator
Copy link
Author

@RokeJulianLockhart I don't know, since I don't need it anymore. But thanks for the response

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