Problem with Authorization Code Flow

Hello everyone,

I am trying to write my own, small app with usage of WoW API and have some problem that I can not figure out.

My app is using react for frontend and Node JS for backend.

I installed this lib:

After sending request with this body:

  • var body = ‘grant_type=authorization_code&’ + req._parsedOriginalUrl.query + ‘&client_id=’ + BNET_ID + ‘&client_secret=’ + BNET_SECRET + ‘&scope=wow.profile’

I receive an error that says: “Invalid authorization code”.

The variable req._parsedOriginalUrl.query is the authorization code I received using the library called passport-bnet. It looks like that, for example:

  • code=EUR5LWEIASINVUsomethingchangedHereHMWRHWWND6USFA

Any ideas why is this not working?

I was successfull with Client Credentials Flow, but that does not give access to Profile API unfortunately.


Figured it out.

I was overthinking it.

All I gotta do was to pass token received via passport-bnet library, read it on front via url param and on front just fetch a url for profile.

Sorry for the trouble :slight_smile: