Gets U4-6753 Identity support must have an option to enable auto-linked accounts working

This commit is contained in:
Shannon
2015-06-26 16:59:40 +02:00
parent 42b2b16f0e
commit b42959f663
7 changed files with 227 additions and 10 deletions

View File

@@ -7,6 +7,31 @@ namespace Umbraco.Web.Security.Identity
{
public static class AuthenticationOptionsExtensions
{
/// <summary>
/// Used during the External authentication process to assign external sign-in options
/// that are used by the Umbraco authentication process.
/// </summary>
/// <param name="authOptions"></param>
/// <param name="options"></param>
public static void SetExternalAuthenticationOptions(
this AuthenticationOptions authOptions,
ExternalSignInAutoLinkOptions options)
{
authOptions.Description.Properties["ExternalSignInAutoLinkOptions"] = options;
}
/// <summary>
/// Used during the External authentication process to retrieve external sign-in options
/// that have been set with SetExternalAuthenticationOptions
/// </summary>
/// <param name="authenticationDescription"></param>
public static ExternalSignInAutoLinkOptions GetExternalAuthenticationOptions(this AuthenticationDescription authenticationDescription)
{
if (authenticationDescription.Properties.ContainsKey("ExternalSignInAutoLinkOptions") == false) return null;
var options = authenticationDescription.Properties["ExternalSignInAutoLinkOptions"] as ExternalSignInAutoLinkOptions;
return options;
}
/// <summary>
/// Configures the properties of the authentication description instance for use with Umbraco back office
/// </summary>