From f60e8b5ffaa708db20df45621209924b4134df96 Mon Sep 17 00:00:00 2001 From: Wouter Van Speybroeck Date: Sun, 1 Apr 2018 08:25:11 +0200 Subject: [PATCH 1/8] NameIDentifier should use Id from context instead of username (#232) --- .../DiscordAuthenticationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Owin.Security.Providers.Discord/DiscordAuthenticationHandler.cs b/src/Owin.Security.Providers.Discord/DiscordAuthenticationHandler.cs index 926e268..6151ea2 100644 --- a/src/Owin.Security.Providers.Discord/DiscordAuthenticationHandler.cs +++ b/src/Owin.Security.Providers.Discord/DiscordAuthenticationHandler.cs @@ -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)) { From 900c80a98f3a7c162ad870c4bb48e46a463bd60e Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sun, 1 Apr 2018 02:25:35 -0400 Subject: [PATCH 2/8] bump version --- Rakefile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile.rb b/Rakefile.rb index c0eb227..4d53f04 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -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.22.0" PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir } desc 'Retrieve things' From 35ea1c9d79f8e29b6abdf1d3ac98dd6b50e105f8 Mon Sep 17 00:00:00 2001 From: James Ruskin Date: Mon, 30 Apr 2018 11:49:04 +0100 Subject: [PATCH 3/8] 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). --- src/Owin.Security.Providers.Steam/SteamAuthenticationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Owin.Security.Providers.Steam/SteamAuthenticationHandler.cs b/src/Owin.Security.Providers.Steam/SteamAuthenticationHandler.cs index 3a89d69..2c50214 100644 --- a/src/Owin.Security.Providers.Steam/SteamAuthenticationHandler.cs +++ b/src/Owin.Security.Providers.Steam/SteamAuthenticationHandler.cs @@ -10,7 +10,7 @@ namespace Owin.Security.Providers.Steam { internal sealed class SteamAuthenticationHandler : OpenIDAuthenticationHandlerBase { - 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}"; From 22c830dbfbee13e8c74ad823b0c2b21edc3f2b9e Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Tue, 1 May 2018 19:51:22 -0400 Subject: [PATCH 4/8] bump version --- Rakefile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile.rb b/Rakefile.rb index 4d53f04..074b75d 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -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.23.0" PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir } desc 'Retrieve things' From c9dd2cc062cfbf95be018dcca4e3c7a6aa35ba25 Mon Sep 17 00:00:00 2001 From: Pedro Rebelo Date: Mon, 4 Jun 2018 16:33:07 +0100 Subject: [PATCH 5/8] Add a Request Prefix to TwitchAuthenticationOptions so that we don't rely always on Request.Scheme or Request.Host. --- .../TwitchAuthenticationHandler.cs | 14 +++++++++----- .../TwitchAuthenticationOptions.cs | 5 +++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs b/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs index b74caa5..4fe5dc9 100644 --- a/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs +++ b/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs @@ -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> @@ -146,9 +145,7 @@ namespace Owin.Security.Providers.Twitch if (challenge == null) return Task.FromResult(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; + } } } \ No newline at end of file diff --git a/src/Owin.Security.Providers.Twitch/TwitchAuthenticationOptions.cs b/src/Owin.Security.Providers.Twitch/TwitchAuthenticationOptions.cs index 881c83a..009512a 100644 --- a/src/Owin.Security.Providers.Twitch/TwitchAuthenticationOptions.cs +++ b/src/Owin.Security.Providers.Twitch/TwitchAuthenticationOptions.cs @@ -125,6 +125,11 @@ namespace Owin.Security.Providers.Twitch /// public bool ForceVerify { get; set; } + /// + /// Gets or sets the Request prefix + /// + public string RequestPrefix { get; set; } + /// /// Initializes a new /// From b4447fa3197d4494de78142fd1a114726866d294 Mon Sep 17 00:00:00 2001 From: Pedro Rebelo Date: Mon, 4 Jun 2018 16:49:34 +0100 Subject: [PATCH 6/8] Little fix on the logic of the last commit. --- .../TwitchAuthenticationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs b/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs index 4fe5dc9..6904049 100644 --- a/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs +++ b/src/Owin.Security.Providers.Twitch/TwitchAuthenticationHandler.cs @@ -237,7 +237,7 @@ namespace Owin.Security.Providers.Twitch private string GetRequestPrefix() { - return String.IsNullOrEmpty(Options.RequestPrefix) + return !String.IsNullOrEmpty(Options.RequestPrefix) ? Options.RequestPrefix : Request.Scheme + Uri.SchemeDelimiter + Request.Host; } From d5d7c19a300bc7a4cea4847a75ab36b3693125fd Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Tue, 12 Jun 2018 21:58:07 -0400 Subject: [PATCH 7/8] bump version --- Rakefile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile.rb b/Rakefile.rb index 074b75d..05d62fd 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -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.23.0" +@version = "2.24.0" PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir } desc 'Retrieve things' From 02fa70bbe309167c903ea1a215f0c66b2f7fbd3c Mon Sep 17 00:00:00 2001 From: Luiz Machado Date: Wed, 8 Aug 2018 16:09:44 -0300 Subject: [PATCH 8/8] fix main heading --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cdb7d36..0472647 100644 --- a/README.md +++ b/README.md @@ -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