Merge pull request #1 from TerribleDev/master

Merge base into fork
This commit is contained in:
Wouter Van Speybroeck
2018-10-15 14:53:32 +02:00
committed by GitHub
6 changed files with 18 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
[![Build status](https://ci.appveyor.com/api/projects/status/gjlkpp86t8dw164f?svg=true)](https://ci.appveyor.com/project/tparnell8/owinoauthproviders)
#OWIN OAuth Providers
# OWIN OAuth Providers
Provides a set of extra authentication providers for OWIN ([Project Katana](http://katanaproject.codeplex.com/)). This project includes providers for:
- OAuth

View File

@@ -15,7 +15,7 @@ PACKAGES = File.expand_path("packages")
TOOLS = File.expand_path("tools")
NUGET = File.expand_path("#{TOOLS}/nuget")
NUGET_EXE = File.expand_path("#{TOOLS}/nuget/nuget.exe")
@version = "2.21.0"
@version = "2.24.0"
PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir }
desc 'Retrieve things'

View File

@@ -105,7 +105,7 @@ namespace Owin.Security.Providers.Discord
};
if (!string.IsNullOrEmpty(context.Id))
{
context.Identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, context.UserName, XmlSchemaString, Options.AuthenticationType));
context.Identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, context.Id, XmlSchemaString, Options.AuthenticationType));
}
if (!string.IsNullOrEmpty(context.UserName))
{

View File

@@ -10,7 +10,7 @@ namespace Owin.Security.Providers.Steam
{
internal sealed class SteamAuthenticationHandler : OpenIDAuthenticationHandlerBase<SteamAuthenticationOptions>
{
private readonly Regex _accountIDRegex = new Regex(@"^http://steamcommunity\.com/openid/id/(7[0-9]{15,25})$", RegexOptions.Compiled);
private readonly Regex _accountIDRegex = new Regex(@"^https?://steamcommunity\.com/openid/id/(7[0-9]{15,25})$", RegexOptions.Compiled);
private const string UserInfoUri = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key={0}&steamids={1}";

View File

@@ -60,8 +60,7 @@ namespace Owin.Security.Providers.Twitch
return new AuthenticationTicket(null, properties);
}
var requestPrefix = Request.Scheme + "://" + Request.Host;
var redirectUri = requestPrefix + Request.PathBase + Options.CallbackPath;
var redirectUri = GetRequestPrefix() + Request.PathBase + Options.CallbackPath;
// Build up the body for the token request
var body = new List<KeyValuePair<string, string>>
@@ -146,9 +145,7 @@ namespace Owin.Security.Providers.Twitch
if (challenge == null) return Task.FromResult<object>(null);
var baseUri =
Request.Scheme +
Uri.SchemeDelimiter +
Request.Host +
GetRequestPrefix() +
Request.PathBase;
var currentUri =
@@ -237,5 +234,12 @@ namespace Owin.Security.Providers.Twitch
return context.IsRequestCompleted;
}
private string GetRequestPrefix()
{
return !String.IsNullOrEmpty(Options.RequestPrefix)
? Options.RequestPrefix
: Request.Scheme + Uri.SchemeDelimiter + Request.Host;
}
}
}

View File

@@ -125,6 +125,11 @@ namespace Owin.Security.Providers.Twitch
/// </summary>
public bool ForceVerify { get; set; }
/// <summary>
/// Gets or sets the Request prefix
/// </summary>
public string RequestPrefix { get; set; }
/// <summary>
/// Initializes a new <see cref="TwitchAuthenticationOptions" />
/// </summary>