Having a lot of trouble performing oauth with a service


There are a lot of oauth packages available, but unfortunately, I need one with Battle.net for my project. The api is listed in here.

However, a problem I have been having is with the state parameter within the request. After configuration, I have been getting this error repeatedly on the server

W20150305-08:58:05.558(-5) (oauth_server.js:78) Unable to parse state from OAuth query: 
W20150305-08:58:05.558(-5) (oauth_server.js:78) Unable to parse state from OAuth query: 
W20150305-08:58:05.559(-5) (oauth_server.js:398) Error in OAuth Server: invalid_request

My url on the client looks as follows:


I create the state as follows:

var credentialToken = Random.secret();
var loginStyle = OAuth._loginStyle('battlenet', config, options);
var state = OAuth._stateParam(loginStyle, credentialToken);

Anyone have any input? I was going off of this example but making my own package for bnet.

EDIT: Adding some details.
I tried using raw HTTP with python.

>>> login_url
>>> response = requests.get(auth_url)
>>> pp(response.json())
{'inputs': [{'input_id': 'account_name',
             'label': 'E-mail',
             'max_length': 320,
             'type': 'text'},
            {'input_id': 'password',
             'label': 'Password',
             'max_length': 16,
             'type': 'password'},
            {'input_id': 'log_in_submit',
             'label': 'Log In',
             'type': 'submit'}],
 'type': 'LOGIN_FORM'}


Are you encoding / decoding the URL? This looks a bit wrong “http%3A%2F%2Fl”

Maybe check out http://meyerweb.com/eric/tools/dencoder/ and http://www.w3schools.com/tags/ref_urlencode.asp