From eef7c4a60f2bc6e664092dfdd03009755c67053b Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Wed, 16 Oct 2013 13:44:41 -0400 Subject: [PATCH] add linked in oauth2 support --- .../ConfigurationDatabaseInitializer.cs | 14 +++++++++++++- .../Models/OAuth2ProviderTypes.cs | 1 + .../Thinktecture.IdentityServer.Protocols.csproj | 4 ++-- .../WSFederation/HrdController.cs | 3 +++ .../packages.config | 2 +- src/OnPremise/WebSite/WebSite.csproj | 4 ++-- src/OnPremise/WebSite/packages.config | 2 +- 7 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ConfigurationDatabaseInitializer.cs b/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ConfigurationDatabaseInitializer.cs index e76681f1..05839fc0 100644 --- a/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ConfigurationDatabaseInitializer.cs +++ b/src/Libraries/Thinktecture.IdentityServer.Core.Repositories/ConfigurationDatabaseInitializer.cs @@ -410,7 +410,19 @@ private static List CreateTestIdentityProviders() ClientID = "00000000480DD362", ClientSecret = "gH9ngNoSaxRrupt3UcynwI2aK8qODZvf", OAuth2ProviderType = 3 - }, + }, + new IdentityProvider + { + Name = "LinkedIn", + DisplayName = "LinkedIn", + Enabled = true, + ShowInHrdSelection = true, + Type = 2, + ClientID = "f8xh60airbta", + ClientSecret = "DGY4NpcP8HiFW004", + OAuth2ProviderType = 4 + }, + }; } diff --git a/src/Libraries/Thinktecture.IdentityServer.Core/Models/OAuth2ProviderTypes.cs b/src/Libraries/Thinktecture.IdentityServer.Core/Models/OAuth2ProviderTypes.cs index 306691e6..d23585ee 100644 --- a/src/Libraries/Thinktecture.IdentityServer.Core/Models/OAuth2ProviderTypes.cs +++ b/src/Libraries/Thinktecture.IdentityServer.Core/Models/OAuth2ProviderTypes.cs @@ -10,5 +10,6 @@ public enum OAuth2ProviderTypes Google = 1, Facebook = 2, Live = 3, + LinkedIn = 4 } } diff --git a/src/Libraries/Thinktecture.IdentityServer.Protocols/Thinktecture.IdentityServer.Protocols.csproj b/src/Libraries/Thinktecture.IdentityServer.Protocols/Thinktecture.IdentityServer.Protocols.csproj index 07947d45..76486f93 100644 --- a/src/Libraries/Thinktecture.IdentityServer.Protocols/Thinktecture.IdentityServer.Protocols.csproj +++ b/src/Libraries/Thinktecture.IdentityServer.Protocols/Thinktecture.IdentityServer.Protocols.csproj @@ -33,9 +33,9 @@ 4 - + False - ..\..\..\packages\BrockAllen.OAuth2.2.2.0\lib\net45\BrockAllen.OAuth2.dll + ..\..\..\packages\BrockAllen.OAuth2.2.3.0\lib\net45\BrockAllen.OAuth2.dll False diff --git a/src/Libraries/Thinktecture.IdentityServer.Protocols/WSFederation/HrdController.cs b/src/Libraries/Thinktecture.IdentityServer.Protocols/WSFederation/HrdController.cs index 1793f79c..9de15f86 100644 --- a/src/Libraries/Thinktecture.IdentityServer.Protocols/WSFederation/HrdController.cs +++ b/src/Libraries/Thinktecture.IdentityServer.Protocols/WSFederation/HrdController.cs @@ -327,6 +327,8 @@ private ActionResult RedirectToOAuth2IdentityProvider(IdentityProvider ip, SignI return new OAuth2ActionResult(oauth2, ProviderType.Facebook, null); case OAuth2ProviderTypes.Live: return new OAuth2ActionResult(oauth2, ProviderType.Live, null); + case OAuth2ProviderTypes.LinkedIn: + return new OAuth2ActionResult(oauth2, ProviderType.LinkedIn, null); } return View("Error"); @@ -386,6 +388,7 @@ ProviderType GetProviderTypeFromOAuthProfileTypes(OAuth2ProviderTypes type) case OAuth2ProviderTypes.Facebook: return ProviderType.Facebook; case OAuth2ProviderTypes.Live: return ProviderType.Live; case OAuth2ProviderTypes.Google: return ProviderType.Google; + case OAuth2ProviderTypes.LinkedIn: return ProviderType.LinkedIn; default: throw new Exception("Invalid OAuthProfileTypes"); } } diff --git a/src/Libraries/Thinktecture.IdentityServer.Protocols/packages.config b/src/Libraries/Thinktecture.IdentityServer.Protocols/packages.config index 8bac76fd..974b72b2 100644 --- a/src/Libraries/Thinktecture.IdentityServer.Protocols/packages.config +++ b/src/Libraries/Thinktecture.IdentityServer.Protocols/packages.config @@ -1,6 +1,6 @@  - + diff --git a/src/OnPremise/WebSite/WebSite.csproj b/src/OnPremise/WebSite/WebSite.csproj index 3d03c03b..560be66d 100644 --- a/src/OnPremise/WebSite/WebSite.csproj +++ b/src/OnPremise/WebSite/WebSite.csproj @@ -49,9 +49,9 @@ False ..\..\..\packages\BrockAllen.CookieTempData.dll.1.2.1\lib\net45\BrockAllen.CookieTempData.dll - + False - ..\..\..\packages\BrockAllen.OAuth2.2.2.0\lib\net45\BrockAllen.OAuth2.dll + ..\..\..\packages\BrockAllen.OAuth2.2.3.0\lib\net45\BrockAllen.OAuth2.dll False diff --git a/src/OnPremise/WebSite/packages.config b/src/OnPremise/WebSite/packages.config index 2fdc227d..12d2c422 100644 --- a/src/OnPremise/WebSite/packages.config +++ b/src/OnPremise/WebSite/packages.config @@ -1,7 +1,7 @@  - +