Compare commits

...

6 Commits

Author SHA1 Message Date
Tommy Parnell
2642736548 bump version 2016-11-01 18:14:18 -04:00
MartinPaulLippert
6cfab46b9d Added LinkedInAuthentication ApplyRedirect (#187)
* Added ApplyRedirect to LinkedInAuthentication Provider
Changed LinkedInAuthenticationHandler to use ApplyRedirect
Added LinkedInApplyRedirectContext

Changes allow a developer to override the authorization endpoint
2016-11-01 18:12:31 -04:00
Tommy Parnell
2567036747 bump version 2016-10-27 08:17:57 -04:00
Tommy Parnell
2e5561befb Merge pull request #185 from diwu86/sf_scope
add id to scope and mobile_phone to context
2016-10-27 08:16:19 -04:00
Di Wu
202f215c19 add id to scope and mobile_phone to context 2016-10-26 16:48:11 -04:00
Tommy Parnell
28b4edbde9 fix readme (#181) 2016-10-06 16:07:25 -04:00
11 changed files with 77 additions and 8 deletions

View File

@@ -84,7 +84,7 @@ A big thanks goes out to all these contributors without whom this would not have
* Ben Foster (https://github.com/benfoster) * Ben Foster (https://github.com/benfoster)
* Jonathan Peterson (https://github.com/eonasdan) * Jonathan Peterson (https://github.com/eonasdan)
For most accurate and up to date list of contributors please see https://github.com/RockstarLabs/OwinOAuthProviders/graphs/contributors For most accurate and up to date list of contributors please see https://github.com/TerribleDev/OwinOAuthProviders/graphs/contributors
## License ## License

View File

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

View File

@@ -16,9 +16,7 @@
There are many individual providers, this package is a meta package that has a dependency on all of them. There are many individual providers, this package is a meta package that has a dependency on all of them.
</summary> </summary>
<releaseNotes> <releaseNotes>
Version 2.3 View the release notes on github
- Added Geni, and discord providers.
- Retarget to .net 4.5 from 4.5.2
</releaseNotes> </releaseNotes>
<copyright>Copyright 2013 - 2016</copyright> <copyright>Copyright 2013 - 2016</copyright>
<tags>owin katana oauth LinkedIn Yahoo Google+ GitHub Reddit Instagram StackExchange SalesForce TripIt Buffer ArcGIS Dropbox Wordpress Battle.NET Yammer OpenID Steam Twitch</tags> <tags>owin katana oauth LinkedIn Yahoo Google+ GitHub Reddit Instagram StackExchange SalesForce TripIt Buffer ArcGIS Dropbox Wordpress Battle.NET Yammer OpenID Steam Twitch</tags>

View File

@@ -19,7 +19,7 @@
Also adds generic OpenID 2.0 providers as well implementations for Steam and Wargaming. Also adds generic OpenID 2.0 providers as well implementations for Steam and Wargaming.
</summary> </summary>
<releaseNotes> <releaseNotes>
- Added Box, and Baidu providers View the release notes on github
</releaseNotes> </releaseNotes>
<copyright>Copyright 2013 - 2016</copyright> <copyright>Copyright 2013 - 2016</copyright>
<tags>owin katana oauth LinkedIn Yahoo Google+ GitHub Reddit Instagram StackExchange SalesForce TripIt Buffer ArcGIS Dropbox Wordpress Battle.NET Yammer OpenID Steam Twitch Box Baidu</tags> <tags>owin katana oauth LinkedIn Yahoo Google+ GitHub Reddit Instagram StackExchange SalesForce TripIt Buffer ArcGIS Dropbox Wordpress Battle.NET Yammer OpenID Steam Twitch Box Baidu</tags>

View File

@@ -213,7 +213,11 @@ namespace Owin.Security.Providers.LinkedIn
"&scope=" + Uri.EscapeDataString(scope) + "&scope=" + Uri.EscapeDataString(scope) +
"&state=" + Uri.EscapeDataString(state); "&state=" + Uri.EscapeDataString(state);
Response.Redirect(authorizationEndpoint);
var redirectContext = new LinkedInApplyRedirectContext(
Context, Options,
properties, authorizationEndpoint);
Options.Provider.ApplyRedirect(redirectContext);
return Task.FromResult<object>(null); return Task.FromResult<object>(null);
} }

View File

@@ -64,6 +64,7 @@
<Compile Include="LinkedInAuthenticationMiddleware.cs" /> <Compile Include="LinkedInAuthenticationMiddleware.cs" />
<Compile Include="LinkedInAuthenticationOptions.cs" /> <Compile Include="LinkedInAuthenticationOptions.cs" />
<Compile Include="Provider\ILinkedInAuthenticationProvider.cs" /> <Compile Include="Provider\ILinkedInAuthenticationProvider.cs" />
<Compile Include="Provider\LinkedInApplyRedirectContext.cs" />
<Compile Include="Provider\LinkedInAuthenticatedContext.cs" /> <Compile Include="Provider\LinkedInAuthenticatedContext.cs" />
<Compile Include="Provider\LinkedInAuthenticationProvider.cs" /> <Compile Include="Provider\LinkedInAuthenticationProvider.cs" />
<Compile Include="Provider\LinkedInReturnEndpointContext.cs" /> <Compile Include="Provider\LinkedInReturnEndpointContext.cs" />

View File

@@ -20,5 +20,11 @@ namespace Owin.Security.Providers.LinkedIn
/// <param name="context"></param> /// <param name="context"></param>
/// <returns>A <see cref="Task"/> representing the completed operation.</returns> /// <returns>A <see cref="Task"/> representing the completed operation.</returns>
Task ReturnEndpoint(LinkedInReturnEndpointContext context); Task ReturnEndpoint(LinkedInReturnEndpointContext context);
/// <summary>
/// Called when a Challenge causes a redirect to authorize endpoint in the LinkedIn middleware
/// </summary>
/// <param name="context">Contains redirect URI and <see cref="AuthenticationProperties"/> of the challenge </param>
void ApplyRedirect(LinkedInApplyRedirectContext context);
} }
} }

View File

@@ -0,0 +1,38 @@
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Provider;
namespace Owin.Security.Providers.LinkedIn
{
/// <summary>
/// Context passed when a Challenge causes a redirect to authorize endpoint in the LinkedIn middleware
/// </summary>
public class LinkedInApplyRedirectContext : BaseContext<LinkedInAuthenticationOptions>
{
/// <summary>
/// Creates a new context object.
/// </summary>
/// <param name="context">The OWIN request context</param>
/// <param name="options">The LinkedIn middleware options</param>
/// <param name="properties">The authenticaiton properties of the challenge</param>
/// <param name="redirectUri">The initial redirect URI</param>
public LinkedInApplyRedirectContext(IOwinContext context, LinkedInAuthenticationOptions options,
AuthenticationProperties properties, string redirectUri)
: base(context, options)
{
RedirectUri = redirectUri;
Properties = properties;
}
/// <summary>
/// Gets the URI used for the redirect operation.
/// </summary>
public string RedirectUri { get; private set; }
/// <summary>
/// Gets the authentication properties of the challenge
/// </summary>
public AuthenticationProperties Properties { get; private set; }
}
}

View File

@@ -15,6 +15,8 @@ namespace Owin.Security.Providers.LinkedIn
{ {
OnAuthenticated = context => Task.FromResult<object>(null); OnAuthenticated = context => Task.FromResult<object>(null);
OnReturnEndpoint = context => Task.FromResult<object>(null); OnReturnEndpoint = context => Task.FromResult<object>(null);
OnApplyRedirect = context =>
context.Response.Redirect(context.RedirectUri);
} }
/// <summary> /// <summary>
@@ -27,6 +29,11 @@ namespace Owin.Security.Providers.LinkedIn
/// </summary> /// </summary>
public Func<LinkedInReturnEndpointContext, Task> OnReturnEndpoint { get; set; } public Func<LinkedInReturnEndpointContext, Task> OnReturnEndpoint { get; set; }
/// <summary>
/// Gets or sets the delegate that is invoked when the ApplyRedirect method is invoked.
/// </summary>
public Action<LinkedInApplyRedirectContext> OnApplyRedirect { get; set; }
/// <summary> /// <summary>
/// Invoked whenever LinkedIn successfully authenticates a user /// Invoked whenever LinkedIn successfully authenticates a user
/// </summary> /// </summary>
@@ -46,5 +53,14 @@ namespace Owin.Security.Providers.LinkedIn
{ {
return OnReturnEndpoint(context); return OnReturnEndpoint(context);
} }
/// <summary>
/// Called when a Challenge causes a redirect to authorize endpoint in the LinkedIn middleware
/// </summary>
/// <param name="context">Contains redirect URI and <see cref="AuthenticationProperties"/> of the challenge </param>
public virtual void ApplyRedirect(LinkedInApplyRedirectContext context)
{
OnApplyRedirect(context);
}
} }
} }

View File

@@ -40,6 +40,7 @@ namespace Owin.Security.Providers.Salesforce
LastName = TryGetValue(user, "last_name"); LastName = TryGetValue(user, "last_name");
TimeZone = TryGetValue(user, "timezone"); TimeZone = TryGetValue(user, "timezone");
Active = TryGetValue(user, "active"); Active = TryGetValue(user, "active");
MobilePhone = TryGetValue(user, "mobile_phone");
} }
/// <summary> /// <summary>
@@ -121,6 +122,11 @@ namespace Owin.Security.Providers.Salesforce
/// </summary> /// </summary>
public string Active { get; private set; } public string Active { get; private set; }
/// <summary>
/// Gets the user's mobile phone number
/// </summary>
public string MobilePhone { get; private set; }
/// <summary> /// <summary>
/// Gets the <see cref="ClaimsIdentity"/> representing the user /// Gets the <see cref="ClaimsIdentity"/> representing the user
/// </summary> /// </summary>

View File

@@ -123,7 +123,7 @@ namespace Owin.Security.Providers.Salesforce
Caption = Constants.DefaultAuthenticationType; Caption = Constants.DefaultAuthenticationType;
CallbackPath = new PathString("/signin-salesforce"); CallbackPath = new PathString("/signin-salesforce");
AuthenticationMode = AuthenticationMode.Passive; AuthenticationMode = AuthenticationMode.Passive;
Scope = new List<string>(); Scope = new List<string> { "id" };
BackchannelTimeout = TimeSpan.FromSeconds(60); BackchannelTimeout = TimeSpan.FromSeconds(60);
Endpoints = new SalesforceAuthenticationEndpoints Endpoints = new SalesforceAuthenticationEndpoints
{ {