Added comments
This commit is contained in:
@@ -3,8 +3,17 @@ using System;
|
||||
|
||||
namespace Owin.Security.Providers.Wargaming
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for using <see cref="WargamingAuthenticationMiddleware"/>
|
||||
/// </summary>
|
||||
public static class WargamingAccountAuthenticationExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Authenticate users using Wargaming
|
||||
/// </summary>
|
||||
/// <param name="app">The <see cref="IAppBuilder"/> passed to the configuration method</param>
|
||||
/// <param name="options">Middleware configuration options</param>
|
||||
/// <returns>The updated <see cref="IAppBuilder"/></returns>
|
||||
public static IAppBuilder UseWargamingAccountAuthentication(this IAppBuilder app, WargamingAuthenticationOptions options)
|
||||
{
|
||||
if (app == null)
|
||||
|
||||
@@ -5,14 +5,11 @@ using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Security.Claims;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.Data;
|
||||
|
||||
namespace Owin.Security.Providers.Wargaming
|
||||
{
|
||||
internal sealed class WargamingAuthenticationHandler : OpenIDAuthenticationHandlerBase<WargamingAuthenticationOptions>
|
||||
{
|
||||
|
||||
private readonly Regex AccountIDRegex = new Regex(@"^https://na.wargaming.net/id/([0-9]{10}).*$", RegexOptions.Compiled);
|
||||
|
||||
private const string UserInfoUri = "https://api.worldoftanks.com/wot/account/info/?application_id={0}&account_id={1}&fields=nickname";
|
||||
|
||||
@@ -11,6 +11,9 @@ using Owin.Security.Providers.OpenID;
|
||||
|
||||
namespace Owin.Security.Providers.Wargaming
|
||||
{
|
||||
/// <summary>
|
||||
/// OWIN middleware for authenticating users using an OpenID provider
|
||||
/// </summary>
|
||||
public class WargamingAuthenticationMiddleware : OpenIDAuthenticationMiddlewareBase<WargamingAuthenticationOptions>
|
||||
{
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace Owin.Security.Providers.Wargaming
|
||||
{
|
||||
public class WargamingAuthenticationOptions : OpenIDAuthenticationOptions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Region to use for to log in
|
||||
/// </summary>
|
||||
public enum Region
|
||||
{
|
||||
Europe,
|
||||
|
||||
Reference in New Issue
Block a user