Compare commits

...

7 Commits

Author SHA1 Message Date
AlastairBateman
49e1126bc7 Updating DropboxAuthenticatedContext.cs and DropboxAuthennticationHandler.cs to use the Dropbox v2 API as they're shutting down their v1 API: https://blogs.dropbox.com/developers/2017/09/api-v1-shutdown-details/ (#216)
As per issue: https://github.com/TerribleDev/OwinOAuthProviders/issues/215
2017-10-13 09:32:16 -04:00
Hoku Kim
ba08bffec3 Added LinkedInAuthenticationOptions.Proxy host for web applications running behind a proxy. This allows the middleware to authenticate for the proxy request host instead of the application request host. (#213) 2017-10-13 09:32:06 -04:00
Tommy Parnell
9bb2a75712 remove unused file 2017-07-16 11:48:21 -04:00
Tommy Parnell
60f3438ce7 strong name all the things 2017-07-16 11:48:03 -04:00
Tommy Parnell
346facbe2f bump version 2017-05-19 17:05:23 -04:00
bkrupa
934d75e9ad Added ability to force verify on twitch authentication (#202) 2017-05-19 16:52:05 -04:00
bencurthoys
feba5cc2fb PayPal TLS Fix (#206)
* PayPal TLS Fix

PayPal requires TLS 1.2 now - Added comments explaining this is the
case, and additional error handling for when the callback fails when TLS
1.0 or 1.1 is set.

* Removed Sandbox Credentials

Tch.

* Changed exception to WebException

If the PayPalAuthenticationHandler sees that an error caused by the
wrong SecurityProtocol has occurred, it throws a new WebException
instead of just Exception

* Reverted Whitespace changes to Startup.Auth.cs

Whitespace somehow got changed. I think this reverts it.
2017-05-19 16:51:53 -04:00
20 changed files with 515 additions and 255 deletions

View File

@@ -23,4 +23,4 @@ DEPENDENCIES
os os
BUNDLED WITH BUNDLED WITH
1.12.1 1.13.7

View File

@@ -3,6 +3,7 @@ using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies; using Microsoft.Owin.Security.Cookies;
using Owin; using Owin;
using Owin.Security.Providers.Evernote; using Owin.Security.Providers.Evernote;
using Owin.Security.Providers.PayPal;
namespace OwinOAuthProvidersDemo namespace OwinOAuthProvidersDemo
{ {
@@ -193,10 +194,20 @@ namespace OwinOAuthProvidersDemo
// clientId: "", // clientId: "",
// clientSecret: ""); // clientSecret: "");
//app.UsePayPalAuthentication( // PayPal no longer supports Tls 1.0 or 1.1
// clientId: "", // https://devblog.paypal.com/upcoming-security-changes-notice/
// clientSecret: "", // http://stackoverflow.com/questions/34939523/the-request-was-aborted-could-not-create-ssl-tls-secure-channel-sandbox-account
// isSandbox: false); // System.Net.ServicePointManager.SecurityProtocol = System.Net.ServicePointManager.SecurityProtocol | System.Net.SecurityProtocolType.Tls12;
// The Return URL must be configured in the PayPal application to https://[hostname][:port]/signin-paypal
// PayPalAuthenticationOptions payPalOptions = new PayPalAuthenticationOptions(true);
// payPalOptions.ClientId = "";
// payPalOptions.ClientSecret = "";
// payPalOptions.Scope.Add("email");
// payPalOptions.Scope.Add("profile");
// payPalOptions.Scope.Add("address");
// payPalOptions.Scope.Add("https://uri.paypal.com/services/expresscheckout");
// app.UsePayPalAuthentication(payPalOptions);
//app.UseWargamingAccountAuthentication("", WargamingAuthenticationOptions.Region.NorthAmerica); //app.UseWargamingAccountAuthentication("", WargamingAuthenticationOptions.Region.NorthAmerica);

View File

@@ -252,14 +252,214 @@
<Content Include="Scripts\jquery-2.2.3.min.map" /> <Content Include="Scripts\jquery-2.2.3.min.map" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\base\Owin.Security.Providers.OpenIDBase\Owin.Security.Providers.OpenIDBase.csproj">
<Project>{4fd7b873-1994-4990-aa40-c37060121494}</Project>
<Name>Owin.Security.Providers.OpenIDBase</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.ArcGISOnline\Owin.Security.Providers.ArcGISOnline.csproj">
<Project>{8a49faef-d365-4d25-942c-1cad03845a5e}</Project>
<Name>Owin.Security.Providers.ArcGISOnline</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Asana\Owin.Security.Providers.Asana.csproj">
<Project>{f3e27220-1d8c-4037-94aa-7b7f4a12f351}</Project>
<Name>Owin.Security.Providers.Asana</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Backlog\Owin.Security.Providers.Backlog.csproj">
<Project>{2dc03778-9ef1-466a-83ec-7d8422decd23}</Project>
<Name>Owin.Security.Providers.Backlog</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Baidu\Owin.Security.Providers.Baidu.csproj">
<Project>{e2759807-4d7c-4288-aac8-f5b7b4616680}</Project>
<Name>Owin.Security.Providers.Baidu</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.BattleNet\Owin.Security.Providers.BattleNet.csproj">
<Project>{99a175da-ade4-436c-a272-c8ae44b7a086}</Project>
<Name>Owin.Security.Providers.BattleNet</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Bitbucket\Owin.Security.Providers.Bitbucket.csproj">
<Project>{e5212fc7-abcb-462f-9989-8e022dffe43c}</Project>
<Name>Owin.Security.Providers.Bitbucket</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Box\Owin.Security.Providers.Box.csproj">
<Project>{1aef8813-e1f9-41e1-bc8d-732960595e9f}</Project>
<Name>Owin.Security.Providers.Box</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Buffer\Owin.Security.Providers.Buffer.csproj">
<Project>{6f75fc1f-d9e9-49b3-a6ce-cfa8feea11a5}</Project>
<Name>Owin.Security.Providers.Buffer</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Cosign\Owin.Security.Providers.Cosign.csproj">
<Project>{1f1f8d6b-7219-46fa-93d3-8d3061a6cbbf}</Project>
<Name>Owin.Security.Providers.Cosign</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.DeviantArt\Owin.Security.Providers.DeviantArt.csproj">
<Project>{fabd2e54-976d-41f5-8800-dee58acc027c}</Project>
<Name>Owin.Security.Providers.DeviantArt</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Discord\Owin.Security.Providers.Discord.csproj">
<Project>{4be728eb-778a-41af-8dea-0c7159711d44}</Project>
<Name>Owin.Security.Providers.Discord</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.DoYouBuzz\Owin.Security.Providers.DoYouBuzz.csproj">
<Project>{4550d8bd-05a7-44f8-bbc0-c3d8e7af2912}</Project>
<Name>Owin.Security.Providers.DoYouBuzz</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Dropbox\Owin.Security.Providers.Dropbox.csproj">
<Project>{cef697b1-3651-49e5-9060-65f2e26c039c}</Project>
<Name>Owin.Security.Providers.Dropbox</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.EVEOnline\Owin.Security.Providers.EVEOnline.csproj">
<Project>{f5dc23f4-5042-4024-9e34-aca648602ba0}</Project>
<Name>Owin.Security.Providers.EVEOnline</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Evernote\Owin.Security.Providers.Evernote.csproj"> <ProjectReference Include="..\src\Owin.Security.Providers.Evernote\Owin.Security.Providers.Evernote.csproj">
<Project>{b8f05057-8b9f-44ce-b983-99cb7c2e9e5a}</Project> <Project>{b8f05057-8b9f-44ce-b983-99cb7c2e9e5a}</Project>
<Name>Owin.Security.Providers.Evernote</Name> <Name>Owin.Security.Providers.Evernote</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Fitbit\Owin.Security.Providers.Fitbit.csproj">
<Project>{ca44d014-5a74-4749-a891-1f711fd3a266}</Project>
<Name>Owin.Security.Providers.Fitbit</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Flickr\Owin.Security.Providers.Flickr.csproj"> <ProjectReference Include="..\src\Owin.Security.Providers.Flickr\Owin.Security.Providers.Flickr.csproj">
<Project>{af6cbeb8-5638-43d4-839e-c81f305960be}</Project> <Project>{af6cbeb8-5638-43d4-839e-c81f305960be}</Project>
<Name>Owin.Security.Providers.Flickr</Name> <Name>Owin.Security.Providers.Flickr</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Foursquare\Owin.Security.Providers.Foursquare.csproj">
<Project>{8acd9194-1efe-4128-ac42-856d856332a4}</Project>
<Name>Owin.Security.Providers.Foursquare</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Geni\Owin.Security.Providers.Geni.csproj">
<Project>{9de25431-f935-48d7-8eb5-acb6f918111c}</Project>
<Name>Owin.Security.Providers.Geni</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.GitHub\Owin.Security.Providers.GitHub.csproj">
<Project>{803f9eb7-029c-45ac-ab81-135e60d5beae}</Project>
<Name>Owin.Security.Providers.GitHub</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Gitter\Owin.Security.Providers.Gitter.csproj">
<Project>{42ec50eb-0c51-460c-93a4-1e007bf1f323}</Project>
<Name>Owin.Security.Providers.Gitter</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.GooglePlus\Owin.Security.Providers.GooglePlus.csproj">
<Project>{d3fef959-0e0e-4f50-954c-f123a0b629dc}</Project>
<Name>Owin.Security.Providers.GooglePlus</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.HealthGraph\Owin.Security.Providers.HealthGraph.csproj">
<Project>{157bb715-29b2-4202-8a59-ccbacfcbedd3}</Project>
<Name>Owin.Security.Providers.HealthGraph</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Imgur\Owin.Security.Providers.Imgur.csproj">
<Project>{101841d3-645e-4a44-af8b-8aaa85ceea4e}</Project>
<Name>Owin.Security.Providers.Imgur</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Instagram\Owin.Security.Providers.Instagram.csproj">
<Project>{041178c4-6131-4d68-9896-ce33124d83a0}</Project>
<Name>Owin.Security.Providers.Instagram</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.LinkedIn\Owin.Security.Providers.LinkedIn.csproj">
<Project>{9fa87825-30e9-48d7-ac4a-39e8f0c2777c}</Project>
<Name>Owin.Security.Providers.LinkedIn</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.MyHeritage\Owin.Security.Providers.MyHeritage.csproj">
<Project>{84795078-31b5-4369-bd1b-f960165f8c71}</Project>
<Name>Owin.Security.Providers.MyHeritage</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Onshape\Owin.Security.Providers.Onshape.csproj">
<Project>{9fec99f8-6f45-40a2-8200-85381434c79a}</Project>
<Name>Owin.Security.Providers.Onshape</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.OpenID\Owin.Security.Providers.OpenID.csproj">
<Project>{90c152d7-9c66-4949-9998-c7ce48b593de}</Project>
<Name>Owin.Security.Providers.OpenID</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Orcid\Owin.Security.Providers.Orcid.csproj">
<Project>{89cb4342-e23d-4e7c-89e5-c369599a5860}</Project>
<Name>Owin.Security.Providers.Orcid</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.PayPal\Owin.Security.Providers.PayPal.csproj">
<Project>{f7129064-3db7-4b79-81d3-80130d664e45}</Project>
<Name>Owin.Security.Providers.PayPal</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Reddit\Owin.Security.Providers.Reddit.csproj">
<Project>{d0cd86c8-a6f9-4c6c-9bf0-eaa461e7fbad}</Project>
<Name>Owin.Security.Providers.Reddit</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Salesforce\Owin.Security.Providers.Salesforce.csproj">
<Project>{827a9d68-0dd4-4c5e-b763-8302faeedecc}</Project>
<Name>Owin.Security.Providers.Salesforce</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Shopify\Owin.Security.Providers.Shopify.csproj">
<Project>{67f12bfb-eb3a-4a86-b5dc-f4c066fdf792}</Project>
<Name>Owin.Security.Providers.Shopify</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.SlackProvider\Owin.Security.Providers.SlackProvider.csproj">
<Project>{3e6f293d-8500-428d-bdc9-27440cc91e16}</Project>
<Name>Owin.Security.Providers.SlackProvider</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.SoundCloud\Owin.Security.Providers.SoundCloud.csproj">
<Project>{2c959026-7058-4302-a6c4-dfd10a030585}</Project>
<Name>Owin.Security.Providers.SoundCloud</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Spotify\Owin.Security.Providers.Spotify.csproj">
<Project>{683b4041-a399-40ce-84b8-392f08a6805d}</Project>
<Name>Owin.Security.Providers.Spotify</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.StackExchange\Owin.Security.Providers.StackExchange.csproj">
<Project>{2c0e07ed-f26d-4ff8-8c3d-f760c09a2d5a}</Project>
<Name>Owin.Security.Providers.StackExchange</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Steam\Owin.Security.Providers.Steam.csproj">
<Project>{312c4ed7-8ca1-4723-9203-abc694dfdc7c}</Project>
<Name>Owin.Security.Providers.Steam</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.TripIt\Owin.Security.Providers.TripIt.csproj">
<Project>{b35e2616-dc00-48b4-bd58-7e23046257f1}</Project>
<Name>Owin.Security.Providers.TripIt</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Twitch\Owin.Security.Providers.Twitch.csproj">
<Project>{c3cf8734-6aac-4f59-9a3e-1cba8582cd48}</Project>
<Name>Owin.Security.Providers.Twitch</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Untappd\Owin.Security.Providers.Untappd.csproj">
<Project>{3e89eca3-f4e7-4181-b26b-8250d5151044}</Project>
<Name>Owin.Security.Providers.Untappd</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Vimeo\Owin.Security.Providers.Vimeo.csproj">
<Project>{98ecc703-d651-4ead-a55d-aa3e903ae4d7}</Project>
<Name>Owin.Security.Providers.Vimeo</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.VisualStudio\Owin.Security.Providers.VisualStudio.csproj">
<Project>{3b19fa31-ddff-427f-9d73-f860de74bbc2}</Project>
<Name>Owin.Security.Providers.VisualStudio</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.VKontakte\Owin.Security.Providers.VKontakte.csproj">
<Project>{32d70e31-3799-482a-ac7a-081ff9206fc3}</Project>
<Name>Owin.Security.Providers.VKontakte</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Wargaming\Owin.Security.Providers.Wargaming.csproj">
<Project>{aa72bfce-8495-4a4d-988d-f8d490521776}</Project>
<Name>Owin.Security.Providers.Wargaming</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.WordPress\Owin.Security.Providers.WordPress.csproj">
<Project>{0ede8223-dd5f-4db8-a98a-64b1f4591f48}</Project>
<Name>Owin.Security.Providers.WordPress</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.WSO2\Owin.Security.Providers.WSO2.csproj">
<Project>{8fd3a9cb-e684-42c0-a8bf-7746fdd3d43c}</Project>
<Name>Owin.Security.Providers.WSO2</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Xing\Owin.Security.Providers.Xing.csproj">
<Project>{d497d8bd-6ef9-4c30-b195-b0dd153418d6}</Project>
<Name>Owin.Security.Providers.Xing</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Yahoo\Owin.Security.Providers.Yahoo.csproj">
<Project>{1765bedb-9e4b-468c-baf6-06784cdced67}</Project>
<Name>Owin.Security.Providers.Yahoo</Name>
</ProjectReference>
<ProjectReference Include="..\src\Owin.Security.Providers.Yammer\Owin.Security.Providers.Yammer.csproj">
<Project>{8d029a93-e687-4ddf-82b0-700ebbf477f7}</Project>
<Name>Owin.Security.Providers.Yammer</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

View File

@@ -9,13 +9,13 @@ require 'nokogiri'
require 'openssl' require 'openssl'
import 'nuget.rake' import 'nuget.rake'
CLEAN.include(['src/**/obj', 'src/**/bin', 'tool', 'packages/**','src/**/*.nuspec', 'src/**/*.nupkg', 'tools', 'packages', '*.nupkg']) CLEAN.include(['src/**/obj', 'Owin.Security.Providers.nuspec', 'Owin.Security.Providers-signed.nuspec' 'src/**/bin', 'tool', 'packages/**','src/**/*.nuspec', 'src/**/*.nupkg', 'tools', 'packages', '*.nupkg'])
Configuration = ENV['CONFIGURATION'] || 'Release' Configuration = ENV['CONFIGURATION'] || 'Release'
PACKAGES = File.expand_path("packages") PACKAGES = File.expand_path("packages")
TOOLS = File.expand_path("tools") TOOLS = File.expand_path("tools")
NUGET = File.expand_path("#{TOOLS}/nuget") NUGET = File.expand_path("#{TOOLS}/nuget")
NUGET_EXE = File.expand_path("#{TOOLS}/nuget/nuget.exe") NUGET_EXE = File.expand_path("#{TOOLS}/nuget/nuget.exe")
@version = "2.12.0" @version = "2.15.1"
PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir } PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir }
desc 'Retrieve things' desc 'Retrieve things'
@@ -31,12 +31,15 @@ task :preflight => [:clean, :build, :nuspec_gen]
desc 'publish' desc 'publish'
task :publish => [:preflight,:nuspec_gen, :nuspec_pack, :nuspec_publish] task :publish => [:preflight,:nuspec_gen, :nuspec_pack, :nuspec_publish]
build :compile do |t| build :compile do |t|
t.prop 'Configuration', Configuration t.prop 'Configuration', Configuration
t.sln = 'OwinOAuthProviders.sln' t.sln = 'OwinOAuthProviders.sln'
t.prop 'SignAssembly', 'true'
t.prop 'AssemblyOriginatorKeyFile', File.expand_path("keypair.snk")
end end
desc "Generate nuspec files" desc "Generate nuspec files"
task :nuspec_gen do task :nuspec_gen do
template = ERB.new(File.read('nuspectemplate.nuspec.erb')) template = ERB.new(File.read('nuspectemplate.nuspec.erb'))
@@ -51,6 +54,7 @@ task :nuspec_gen do
File.write('Owin.Security.Providers.nuspec', ERB.new(File.read('global.nuspec.erb')).result()) File.write('Owin.Security.Providers.nuspec', ERB.new(File.read('global.nuspec.erb')).result())
end end
desc 'pack nuspec files' desc 'pack nuspec files'
task :nuspec_pack do task :nuspec_pack do
PROJECTS.each{|dir| PROJECTS.each{|dir|
@@ -61,6 +65,7 @@ task :nuspec_pack do
sh "#{NUGET_EXE} pack Owin.Security.Providers.nuspec -Exclude \"**\"" sh "#{NUGET_EXE} pack Owin.Security.Providers.nuspec -Exclude \"**\""
end end
desc 'publish nugets' desc 'publish nugets'
task :nuspec_publish do task :nuspec_publish do
PROJECTS.each{|dir| PROJECTS.each{|dir|

View File

@@ -89,6 +89,10 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keypair.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>Owin.Security.Providers.OpenIDBase</id> <id>Owin.Security.Providers.OpenIDBase</id>
<version>2.1</version> <version>2.1.1</version>
<authors>Jerrie Pelser, Tommy Parnell and contributors</authors> <authors>Jerrie Pelser, Tommy Parnell and contributors</authors>
<owners>Tommy Parnell</owners> <owners>Tommy Parnell</owners>
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl> <licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>

BIN
keypair.snk Normal file

Binary file not shown.

View File

@@ -17,8 +17,9 @@ namespace Owin.Security.Providers.Dropbox
{ {
private const string StateCookie = "_DropboxState"; private const string StateCookie = "_DropboxState";
private const string XmlSchemaString = "http://www.w3.org/2001/XMLSchema#string"; private const string XmlSchemaString = "http://www.w3.org/2001/XMLSchema#string";
private const string TokenEndpoint = "https://api.dropbox.com/1/oauth2/token"; private const string TokenEndpoint = "https://api.dropbox.com/oauth2/token";
private const string UserInfoEndpoint = "https://api.dropbox.com/1/account/info"; private const string UserInfoEndpoint = "https://api.dropbox.com/2/users/get_current_account";
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly HttpClient _httpClient; private readonly HttpClient _httpClient;
@@ -65,13 +66,13 @@ namespace Owin.Security.Providers.Dropbox
var redirectUri = requestPrefix + Request.PathBase + Options.CallbackPath; var redirectUri = requestPrefix + Request.PathBase + Options.CallbackPath;
// Build up the body for the token request // Build up the body for the token request
var body = new List<KeyValuePair<string, string>> var body = new Dictionary<string, string>
{ {
new KeyValuePair<string, string>("grant_type", "authorization_code"), { "grant_type", "authorization_code" },
new KeyValuePair<string, string>("code", code), { "code", code },
new KeyValuePair<string, string>("redirect_uri", redirectUri), {"redirect_uri", redirectUri },
new KeyValuePair<string, string>("client_id", Options.AppKey), { "client_id", Options.AppKey },
new KeyValuePair<string, string>("client_secret", Options.AppSecret) { "client_secret", Options.AppSecret }
}; };
// Request the token // Request the token
@@ -85,8 +86,8 @@ namespace Owin.Security.Providers.Dropbox
var accessToken = (string)response.access_token; var accessToken = (string)response.access_token;
// Get the Dropbox user // Get the Dropbox user
var graphResponse = await _httpClient.GetAsync( _httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken);
UserInfoEndpoint + "?access_token=" + Uri.EscapeDataString(accessToken), Request.CallCancelled); var graphResponse = await _httpClient.PostAsync(UserInfoEndpoint, null);
graphResponse.EnsureSuccessStatusCode(); graphResponse.EnsureSuccessStatusCode();
text = await graphResponse.Content.ReadAsStringAsync(); text = await graphResponse.Content.ReadAsStringAsync();
var user = JObject.Parse(text); var user = JObject.Parse(text);
@@ -154,7 +155,7 @@ namespace Owin.Security.Providers.Dropbox
GenerateCorrelationId(properties); GenerateCorrelationId(properties);
var authorizationEndpoint = var authorizationEndpoint =
"https://www.dropbox.com/1/oauth2/authorize" + "https://www.dropbox.com/oauth2/authorize" +
"?response_type=code" + "?response_type=code" +
"&client_id=" + Uri.EscapeDataString(Options.AppKey) + "&client_id=" + Uri.EscapeDataString(Options.AppKey) +
"&redirect_uri=" + Uri.EscapeDataString(redirectUri); "&redirect_uri=" + Uri.EscapeDataString(redirectUri);

View File

@@ -25,7 +25,7 @@ namespace Owin.Security.Providers.Dropbox
AccessToken = accessToken; AccessToken = accessToken;
User = user; User = user;
Id = TryGetValue(user, "uid"); Id = TryGetValue(user, "account_id");
Name = TryGetValue(user, "display_name"); Name = TryGetValue(user, "display_name");
} }

View File

@@ -61,7 +61,7 @@ namespace Owin.Security.Providers.LinkedIn
return new AuthenticationTicket(null, properties); return new AuthenticationTicket(null, properties);
} }
var requestPrefix = Request.Scheme + "://" + Request.Host; var requestPrefix = Request.Scheme + "://" + this.GetHostName();
var redirectUri = requestPrefix + Request.PathBase + Options.CallbackPath; var redirectUri = requestPrefix + Request.PathBase + Options.CallbackPath;
// Build up the body for the token request // Build up the body for the token request
@@ -173,7 +173,7 @@ namespace Owin.Security.Providers.LinkedIn
var baseUri = var baseUri =
Request.Scheme + Request.Scheme +
Uri.SchemeDelimiter + Uri.SchemeDelimiter +
Request.Host + this.GetHostName() +
Request.PathBase; Request.PathBase;
var currentUri = var currentUri =
@@ -271,5 +271,15 @@ namespace Owin.Security.Providers.LinkedIn
return context.IsRequestCompleted; return context.IsRequestCompleted;
} }
/// <summary>
/// Gets proxy host name from <see cref="LinkedInAuthenticationOptions"/> if it is set.
/// If proxy host name is not set, gets application request host name.
/// </summary>
/// <returns>Host name.</returns>
private string GetHostName()
{
return string.IsNullOrWhiteSpace(Options.ProxyHost) ? Request.Host.ToString() : Options.ProxyHost;
}
} }
} }

View File

@@ -43,6 +43,16 @@ namespace Owin.Security.Providers.LinkedIn
/// </summary> /// </summary>
public PathString CallbackPath { get; set; } public PathString CallbackPath { get; set; }
/// <summary>
/// Gets or sets the middleware host name.
/// The middleware processes the <see cref="CallbackPath"/> on this host name instead of the application's request host.
/// If this is not set, the application's request host will be used.
/// </summary>
/// <remarks>
/// Use this property when running behind a proxy.
/// </remarks>
public string ProxyHost { get; set; }
/// <summary> /// <summary>
/// Get or sets the text that the user can display on a sign in user interface. /// Get or sets the text that the user can display on a sign in user interface.
/// </summary> /// </summary>

View File

@@ -46,9 +46,8 @@
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> <HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Owin.Security.Providers.OpenIDBase, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Owin.Security.Providers.OpenIDBase, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1328b8c16b108c43, processorArchitecture=MSIL">
<HintPath>..\..\packages\Owin.Security.Providers.OpenIDBase.2.1\lib\net45\Owin.Security.Providers.OpenIDBase.dll</HintPath> <HintPath>..\..\packages\Owin.Security.Providers.OpenIDBase.2.1.1\lib\net45\Owin.Security.Providers.OpenIDBase.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View File

@@ -4,5 +4,5 @@
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" /> <package id="Owin" version="1.0" targetFramework="net45" />
<package id="Owin.Security.Providers.OpenIDBase" version="2.1" targetFramework="net45" /> <package id="Owin.Security.Providers.OpenIDBase" version="2.1.1" targetFramework="net45" />
</packages> </packages>

View File

@@ -81,9 +81,25 @@ namespace Owin.Security.Providers.PayPal
new KeyValuePair<string, string>("code", code), new KeyValuePair<string, string>("code", code),
new KeyValuePair<string, string>("redirect_uri", redirectUri), new KeyValuePair<string, string>("redirect_uri", redirectUri),
}); });
string text = "";
try
{
var tokenResponse = await _httpClient.SendAsync(requestMessage); var tokenResponse = await _httpClient.SendAsync(requestMessage);
tokenResponse.EnsureSuccessStatusCode(); tokenResponse.EnsureSuccessStatusCode();
var text = await tokenResponse.Content.ReadAsStringAsync(); text = await tokenResponse.Content.ReadAsStringAsync();
}
catch (HttpRequestException ex)
{
if (ex.InnerException is System.Net.WebException && ex.InnerException.Message.Contains("TLS"))
{
if (!System.Net.ServicePointManager.SecurityProtocol.HasFlag(System.Net.SecurityProtocolType.Tls12))
{
throw new System.Net.WebException("PayPal requires TLS v1.2. TLS v1.0 and v1.1 connections will be refused. Set System.Net.ServicePointManager.SecurityProtocol = System.Net.ServicePointManager.SecurityProtocol | System.Net.SecurityProtocolType.Tls12", ex.InnerException);
}
}
throw;
}
// Deserializes the token response // Deserializes the token response
var response = JsonConvert.DeserializeObject<dynamic>(text); var response = JsonConvert.DeserializeObject<dynamic>(text);

View File

@@ -46,9 +46,8 @@
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> <HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Owin.Security.Providers.OpenIDBase, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Owin.Security.Providers.OpenIDBase, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1328b8c16b108c43, processorArchitecture=MSIL">
<HintPath>..\..\packages\Owin.Security.Providers.OpenIDBase.2.1\lib\net45\Owin.Security.Providers.OpenIDBase.dll</HintPath> <HintPath>..\..\packages\Owin.Security.Providers.OpenIDBase.2.1.1\lib\net45\Owin.Security.Providers.OpenIDBase.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View File

@@ -4,5 +4,5 @@
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" /> <package id="Owin" version="1.0" targetFramework="net45" />
<package id="Owin.Security.Providers.OpenIDBase" version="2.1" targetFramework="net45" /> <package id="Owin.Security.Providers.OpenIDBase" version="2.1.1" targetFramework="net45" />
</packages> </packages>

View File

@@ -179,6 +179,7 @@ namespace Owin.Security.Providers.Twitch
"?client_id=" + Uri.EscapeDataString(Options.ClientId) + "?client_id=" + Uri.EscapeDataString(Options.ClientId) +
"&redirect_uri=" + Uri.EscapeDataString(redirectUri) + "&redirect_uri=" + Uri.EscapeDataString(redirectUri) +
"&scope=" + Uri.EscapeDataString(scope) + "&scope=" + Uri.EscapeDataString(scope) +
"&force_verify=" + Options.ForceVerify.ToString().ToLower() +
"&response_type=" + "code" + "&response_type=" + "code" +
"&state=" + Uri.EscapeDataString(state); "&state=" + Uri.EscapeDataString(state);

View File

@@ -120,6 +120,11 @@ namespace Owin.Security.Providers.Twitch
/// </summary> /// </summary>
public ISecureDataFormat<AuthenticationProperties> StateDataFormat { get; set; } public ISecureDataFormat<AuthenticationProperties> StateDataFormat { get; set; }
/// <summary>
/// Gets or sets whether to force verify the user during the OAuth flow
/// </summary>
public bool ForceVerify { get; set; }
/// <summary> /// <summary>
/// Initializes a new <see cref="TwitchAuthenticationOptions" /> /// Initializes a new <see cref="TwitchAuthenticationOptions" />
/// </summary> /// </summary>

View File

@@ -46,9 +46,8 @@
<HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> <HintPath>..\..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Owin.Security.Providers.OpenIDBase, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Owin.Security.Providers.OpenIDBase, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1328b8c16b108c43, processorArchitecture=MSIL">
<HintPath>..\..\packages\Owin.Security.Providers.OpenIDBase.2.1\lib\net45\Owin.Security.Providers.OpenIDBase.dll</HintPath> <HintPath>..\..\packages\Owin.Security.Providers.OpenIDBase.2.1.1\lib\net45\Owin.Security.Providers.OpenIDBase.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View File

@@ -4,5 +4,5 @@
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" /> <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" /> <package id="Owin" version="1.0" targetFramework="net45" />
<package id="Owin.Security.Providers.OpenIDBase" version="2.1" targetFramework="net45" /> <package id="Owin.Security.Providers.OpenIDBase" version="2.1.1" targetFramework="net45" />
</packages> </packages>