Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2642736548 | ||
|
|
6cfab46b9d |
@@ -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.10.0"
|
||||
@version = "2.11.0"
|
||||
PROJECTS = Dir.glob('src/*').select{|dir| File.directory? dir }
|
||||
|
||||
desc 'Retrieve things'
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
There are many individual providers, this package is a meta package that has a dependency on all of them.
|
||||
</summary>
|
||||
<releaseNotes>
|
||||
Version 2.3
|
||||
- Added Geni, and discord providers.
|
||||
- Retarget to .net 4.5 from 4.5.2
|
||||
View the release notes on github
|
||||
</releaseNotes>
|
||||
<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>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
Also adds generic OpenID 2.0 providers as well implementations for Steam and Wargaming.
|
||||
</summary>
|
||||
<releaseNotes>
|
||||
- Added Box, and Baidu providers
|
||||
View the release notes on github
|
||||
</releaseNotes>
|
||||
<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>
|
||||
|
||||
@@ -213,7 +213,11 @@ namespace Owin.Security.Providers.LinkedIn
|
||||
"&scope=" + Uri.EscapeDataString(scope) +
|
||||
"&state=" + Uri.EscapeDataString(state);
|
||||
|
||||
Response.Redirect(authorizationEndpoint);
|
||||
|
||||
var redirectContext = new LinkedInApplyRedirectContext(
|
||||
Context, Options,
|
||||
properties, authorizationEndpoint);
|
||||
Options.Provider.ApplyRedirect(redirectContext);
|
||||
|
||||
return Task.FromResult<object>(null);
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
<Compile Include="LinkedInAuthenticationMiddleware.cs" />
|
||||
<Compile Include="LinkedInAuthenticationOptions.cs" />
|
||||
<Compile Include="Provider\ILinkedInAuthenticationProvider.cs" />
|
||||
<Compile Include="Provider\LinkedInApplyRedirectContext.cs" />
|
||||
<Compile Include="Provider\LinkedInAuthenticatedContext.cs" />
|
||||
<Compile Include="Provider\LinkedInAuthenticationProvider.cs" />
|
||||
<Compile Include="Provider\LinkedInReturnEndpointContext.cs" />
|
||||
|
||||
@@ -20,5 +20,11 @@ namespace Owin.Security.Providers.LinkedIn
|
||||
/// <param name="context"></param>
|
||||
/// <returns>A <see cref="Task"/> representing the completed operation.</returns>
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ namespace Owin.Security.Providers.LinkedIn
|
||||
{
|
||||
OnAuthenticated = context => Task.FromResult<object>(null);
|
||||
OnReturnEndpoint = context => Task.FromResult<object>(null);
|
||||
OnApplyRedirect = context =>
|
||||
context.Response.Redirect(context.RedirectUri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -27,6 +29,11 @@ namespace Owin.Security.Providers.LinkedIn
|
||||
/// </summary>
|
||||
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>
|
||||
/// Invoked whenever LinkedIn successfully authenticates a user
|
||||
/// </summary>
|
||||
@@ -46,5 +53,14 @@ namespace Owin.Security.Providers.LinkedIn
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user