Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

State and tests #301

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,38 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
public static class OpenIdConnectAuthenticationDefaults
{
/// <summary>
/// The default value used for OpenIdConnectAuthenticationOptions.AuthenticationScheme
/// Constant used to identify state in openIdConnect protocol message.
/// </summary>
public const string AuthenticationScheme = "OpenIdConnect";
public const string AuthenticationPropertiesKey = "OpenIdConnect.AuthenticationProperties";

/// <summary>
/// The prefix used to provide a default OpenIdConnectAuthenticationOptions.CookieName
/// The default value used for OpenIdConnectAuthenticationOptions.AuthenticationScheme.
/// </summary>
public const string CookiePrefix = ".AspNet.OpenIdConnect.";
public const string AuthenticationScheme = "OpenIdConnect";

/// <summary>
/// The default value for OpenIdConnectAuthenticationOptions.Caption.
/// </summary>
public const string Caption = "OpenIdConnect";

/// <summary>
/// The prefix used to for the a nonce in the cookie
/// The prefix used to provide a default OpenIdConnectAuthenticationOptions.CookieName.
/// </summary>
public const string CookiePrefix = ".AspNet.OpenIdConnect.";

/// <summary>
/// The prefix used to for the a nonce in the cookie.
/// </summary>
public const string CookieNoncePrefix = ".AspNet.OpenIdConnect.Nonce.";

/// <summary>
/// The property for the RedirectUri that was used when asking for a 'authorizationCode'
/// The property for the RedirectUri that was used when asking for a 'authorizationCode'.
/// </summary>
public const string RedirectUriUsedForCodeKey = "OpenIdConnect.Code.RedirectUri";
public const string RedirectUriForCodePropertiesKey = "OpenIdConnect.Code.RedirectUri";

/// <summary>
/// Constant used to identify state in openIdConnect protocal message
/// Constant used to identify userstate inside AuthenticationProperties that have been serialized in the 'state' parameter.
/// </summary>
public const string AuthenticationPropertiesKey = "OpenIdConnect.AuthenticationProperties";
public const string UserstatePropertiesKey = "OpenIdConnect.Userstate";
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,20 @@ public class OpenIdConnectAuthenticationMiddleware : AuthenticationMiddleware<Op
/// <param name="next">The next middleware in the ASP.NET pipeline to invoke.</param>
/// <param name="dataProtectionProvider"> provider for creating a data protector.</param>
/// <param name="loggerFactory">factory for creating a <see cref="ILogger"/>.</param>
/// <param name="encoder"><see cref="IUrlEncoder"/> for encoding query strings.</param>
/// <param name="externalOptions"></param>
/// <param name="options">a <see cref="IOptions{OpenIdConnectAuthenticationOptions}"/> instance that will supply <see cref="OpenIdConnectAuthenticationOptions"/>
/// if configureOptions is null.</param>
/// <param name="configureOptions">a <see cref="ConfigureOptions{OpenIdConnectAuthenticationOptions}"/> instance that will be passed to an instance of <see cref="OpenIdConnectAuthenticationOptions"/>
/// that is retrieved by calling <see cref="IOptions{OpenIdConnectAuthenticationOptions}.GetNamedOptions(string)"/> where string == <see cref="ConfigureOptions{OpenIdConnectAuthenticationOptions}.Name"/> provides runtime configuration.</param>
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Managed by caller")]
public OpenIdConnectAuthenticationMiddleware(
[NotNull] RequestDelegate next,
[NotNull] IOptions<OpenIdConnectAuthenticationOptions> options,
[NotNull] IDataProtectionProvider dataProtectionProvider,
[NotNull] ILoggerFactory loggerFactory,
[NotNull] IUrlEncoder encoder,
[NotNull] IOptions<ExternalAuthenticationOptions> externalOptions,
[NotNull] IOptions<OpenIdConnectAuthenticationOptions> options,
ConfigureOptions<OpenIdConnectAuthenticationOptions> configureOptions = null)
: base(next, options, loggerFactory, encoder, configureOptions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public OpenIdConnectAuthenticationNotifications()
MessageReceived = notification => Task.FromResult(0);
SecurityTokenReceived = notification => Task.FromResult(0);
SecurityTokenValidated = notification => Task.FromResult(0);
RedirectToIdentityProvider = notification => Task.FromResult(0);
}

/// <summary>
Expand Down Expand Up @@ -55,6 +54,5 @@ public OpenIdConnectAuthenticationNotifications()
/// Invoked after the security token has passed validation and a ClaimsIdentity has been generated.
/// </summary>
public Func<SecurityTokenValidatedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions>, Task> SecurityTokenValidated { get; set; }

}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading