avivbiton / BlizzardApiReader

.Net Core library to handle Blizzard public APIs
MIT License
35 stars 36 forks source link

Migrate to the new developer api #35

Closed avivbiton closed 5 years ago

avivbiton commented 5 years ago

Blizzard launched new api portal. https://develop.battle.net/documentation/guides/migration-guide

linahanner commented 5 years ago

The old API portal will work until January 6th in 2019 for anyone in possession of an API key. From my understanding it will not be possible to create a new API key if you don't already have one.

The real difference between the old and new API portals is the new portal requires OAuth authentication. This will require a Client ID and Client Secret. We could add an option to the ApiConfiguration for the time being which allows the user to use OAuth will all necessary values such as redirect uri, scopes & etc. Depending on this value the Reader will choose to either retrieve tokens when appropriate (OAuth) or use the API key. And then we can force it to OAuth at January 6th and forward.

We also need to implement an OAuth flow, which might potentially mean requiring a database in order to store user-specific access tokens.

avivbiton commented 5 years ago

Working on this, my issue right now is that I am getting authentication error when requesting an access token. Will look into more of this, if you have useful info on how to do the authentication correctly please tell me.

linahanner commented 5 years ago

Note the following:

_Edit: I wasn't able to get a token for a brief moment when communicating with the EU servers, received 403 Forbidden response. Looked at the their customer support (@BlizzardCSEU_EN) and this was apparently an issue for a while yesterday. Maybe this is what you were experiencing? Hope it works!_

avivbiton commented 5 years ago

Yeah, I managed to get that working. Will finish it soon (hopefully)

avivbiton commented 5 years ago

38