Compare commits

...

7 Commits

Author SHA1 Message Date
Tommy Parnell
d5d7c19a30 bump version 2018-06-12 21:58:07 -04:00
Tommy Parnell
05cd9a4fab Merge pull request #239 from pdsrebelo/master
Add a Request Prefix to Options so that we don't rely always on Request.Scheme or Request.Host.
2018-06-12 21:57:30 -04:00
Pedro Rebelo
b4447fa319 Little fix on the logic of the last commit. 2018-06-04 16:49:34 +01:00
Pedro Rebelo
c9dd2cc062 Add a Request Prefix to TwitchAuthenticationOptions so that we don't rely always on Request.Scheme or Request.Host. 2018-06-04 16:33:07 +01:00
Tommy Parnell
22c830dbfb bump version 2018-05-01 19:51:22 -04:00
Tommy Parnell
06457050a8 Merge pull request #236 from JPRuskin/patch-1
Update Steam OpenID Regex to handle HTTPS
2018-05-01 19:50:30 -04:00
James Ruskin
35ea1c9d79 Update Steam OpenID Regex to handle HTTPS
Steam have updated their implementation to return https URIs in claimedID (please see [this thread](https://www.reddit.com/r/Steam/comments/8a7gsu/steam_openid_broken_for_many_websites_fix_inside/)).

The current version of the `_accountIDRegex` does not handle this.

This change should fix this. Arguably, we should not include the option to accept http, as Steam have (seemingly) irrevocably changed this.

This should solve [Issue #234](https://github.com/TerribleDev/OwinOAuthProviders/issues/234).
2018-04-30 11:49:04 +01:00
4 changed files with 16 additions and 7 deletions

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.22.0"
@version = "2.24.0"
PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir }
desc 'Retrieve things'

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>