Reputation: 7495
I would like to write an ASP.NET 5 MVC6 website to interact with the BattleNet API.
The website is setup, I have created a BattleNet application authentication and key. Now I wish to authenticate against the BattleNet service but I do not know how to authenticate against the OAuth2 security using ASP.NET 5.
My research indicates that some part of security was not copied over for ASP.NET 5. BattleNet recommends using a well established library for OAuth2.
How do I authenticate against the BattleNet service using C# ASP.NET 5?
NB: Please provide answers and not confirmation of the situation.
Upvotes: 0
Views: 768
Reputation: 42100
There's an ASP.NET 5 middleware for Battle.NET: https://www.nuget.org/packages/AspNet.Security.OAuth.BattleNet/
You can find more information about this project - and the other providers - here: https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers/
Configuring it should be relatively easy:
app.UseBattleNetAuthentication(options => {
options.ClientId = "client_id";
options.ClientSecret = "client_secret";
// America is the default region, but you can change it.
options.Region = BattleNetAuthenticationRegion.Europe;
});
Upvotes: 1