Django Library for BattleNets oAuth2

API Discussion
Since I couldn't find an existing library that handles oAuth2, I wrote my own wrapper class around a few Requests (http://docs.python-requests.org/) HTTP calls & felt like sharing.

https://github.com/chrisgibson17/django-battlenet-oauth2

I think I might have to rename it, since its now public, but not 100% sure.

Right now, it just handles the oAuth authentication flow, then requests the Users characters to prove that it was successful, but its good enough to integrate to a registration system as is.

Let me know if you find this useful, or just saves you some time.

Feel free to make pull requests to add more functionality. I'm going to be adding all API endpoints eventually, but feel free to help out!
Woah I've been looking for a starting point, tried to make it work python-social-auth, but I got stuck there. Thank you for your work.
Hi all,

Just a note to say I've updated this quite a bit with a more logical directory structure etc & its installable to your Python path now.
Update:

I've added all WoW endpoints & reimplemented my OAuth2 code using https://github.com/requests/requests-oauthlib (Woot a real life python lib that does OAuth2!!)

If anyone uses it, please let me know what you think :)
Hi,

glad that someone got into that.

I was facing the same problem, but i wanted to use python-social-auth. So i got together with its developer and we made it work in a couple of hours. It even enables a user to select one of his toons name as username in django.

Until my pull request is included in the official repo, look here: https://github.com/omab/python-social-auth/pull/397
Howdy! In general we're ok with names for plugins that describe what they do using bnet or battle.net. So in this case django-battlenet-oauth2 is a pretty descriptive name, so in that case it's cool.

That being said we would ask people to try and make sure their libraries and apps can not be confused with officially battle.net offerings. So please don't name your websites or applications with battle.net in the name :)

Thanks!
Also, it may be a good idea to drop a note in your README to say that your project isn't officially affiliated with Blizzard Entertainment, copyrights to their respective owners, etc. etc.
Hi, i made another pull request to incorporate the suggested information.
Hi all!

I am trying to sign up with django-battlenet-oauth2, but I allways get the same response:

error="invalid_grant", error_description="Invalid redirect: https://eu.battle.net/oauth/token does not match one of the registered values: [https://dev.battle.net/]"

I have changed my settings.BNET_REDIRECT_URI, but the message is the same. And if I go to eu.battle.net I am loged in.

Thanks :)
09/25/2014 08:30 AMPosted by Fullop
Hi,

glad that someone got into that.

I was facing the same problem, but i wanted to use python-social-auth. So i got together with its developer and we made it work in a couple of hours. It even enables a user to select one of his toons name as username in django.

Until my pull request is included in the official repo, look here: https://github.com/omab/python-social-auth/pull/397


Good work! I have worked with python-social-auth for some time and I like it.

I think you should create a new thread about this support in python-social-auth and make sure that it's added to the Community Created Librabry thread.
Hi Shadow,

I've made a pull request for you, as it seems one of your endpoints were pointing to the wrong URL. The pull request should address this issue.

Otherwise a fantastic library and one I'm very happy to have stumbled across.
Update:


    Added D3 endpoints!
    Now available on PyPi!


pip install django-battlenet

Join the Conversation

Return to Forum