Cleaning up comments and some TODOs.
This commit is contained in:
parent
cdbd003bb1
commit
c53394e847
|
|
@ -148,7 +148,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
/// recommends adding a nonce to a request as a mitigation against replay attacks when requesting id_tokens.
|
/// recommends adding a nonce to a request as a mitigation against replay attacks when requesting id_tokens.
|
||||||
/// By default the runtime uses cookies with unique names generated from a hash of the nonce.
|
/// By default the runtime uses cookies with unique names generated from a hash of the nonce.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public INonceCache NoneCache { get; set; }
|
public INonceCache NonceCache { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the discovery endpoint for obtaining metadata
|
/// Gets or sets the discovery endpoint for obtaining metadata
|
||||||
|
|
@ -181,7 +181,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
public OpenIdConnectAuthenticationNotifications Notifications { get; set; }
|
public OpenIdConnectAuthenticationNotifications Notifications { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the <see cref="OpenIdConnectProtocolValidator"/> that is used ensure the 'id_token' received
|
/// Gets or sets the <see cref="OpenIdConnectProtocolValidator"/> that is used to ensure that the 'id_token' received
|
||||||
/// is valid per: http://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation
|
/// is valid per: http://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <exception cref="ArgumentNullException">if 'value' is null.</exception>
|
/// <exception cref="ArgumentNullException">if 'value' is null.</exception>
|
||||||
|
|
@ -262,7 +262,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the type used to secure strings used by the middleware.
|
/// Gets or sets the type used to secure strings used by the middleware.
|
||||||
// </summary>
|
/// </summary>
|
||||||
public ISecureDataFormat<string> StringDataFormat
|
public ISecureDataFormat<string> StringDataFormat
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
// Set End_Session_Endpoint in order:
|
// Set End_Session_Endpoint in order:
|
||||||
// 1. properties.Redirect
|
// 1. properties.Redirect
|
||||||
// 2. Options.Wreply
|
// 2. Options.Wreply
|
||||||
AuthenticationProperties properties = new AuthenticationProperties(); // TODO signout.Properties;
|
AuthenticationProperties properties = new AuthenticationProperties();
|
||||||
if (properties != null && !string.IsNullOrEmpty(properties.RedirectUri))
|
if (properties != null && !string.IsNullOrEmpty(properties.RedirectUri))
|
||||||
{
|
{
|
||||||
openIdConnectMessage.PostLogoutRedirectUri = properties.RedirectUri;
|
openIdConnectMessage.PostLogoutRedirectUri = properties.RedirectUri;
|
||||||
|
|
@ -111,7 +111,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Responds to a 401 Challenge sends an OpenIdConnect message to the 'identity authority' to obtain an identity.
|
/// Responds to a 401 Challenge. Sends an OpenIdConnect message to the 'identity authority' to obtain an identity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected override async Task ApplyResponseChallengeAsync()
|
protected override async Task ApplyResponseChallengeAsync()
|
||||||
|
|
@ -158,9 +158,9 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
if (Options.ProtocolValidator.RequireNonce)
|
if (Options.ProtocolValidator.RequireNonce)
|
||||||
{
|
{
|
||||||
openIdConnectMessage.Nonce = Options.ProtocolValidator.GenerateNonce();
|
openIdConnectMessage.Nonce = Options.ProtocolValidator.GenerateNonce();
|
||||||
if (Options.NoneCache != null)
|
if (Options.NonceCache != null)
|
||||||
{
|
{
|
||||||
Options.NoneCache.AddNonce(openIdConnectMessage.Nonce);
|
Options.NonceCache.AddNonce(openIdConnectMessage.Nonce);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -215,7 +215,6 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
IFormCollection form = await Request.ReadFormAsync();
|
IFormCollection form = await Request.ReadFormAsync();
|
||||||
Request.Body.Seek(0, SeekOrigin.Begin);
|
Request.Body.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
// TODO: a delegate on OpenIdConnectAuthenticationOptions would allow for users to hook their own custom message.
|
|
||||||
openIdConnectMessage = new OpenIdConnectMessage(form);
|
openIdConnectMessage = new OpenIdConnectMessage(form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -466,7 +465,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="nonceExpectedValue">the nonce that was found in the jwt token.</param>
|
/// <param name="nonceExpectedValue">the nonce that was found in the jwt token.</param>
|
||||||
/// <returns>'nonceExpectedValue' if a cookie is found that matches, null otherwise.</returns>
|
/// <returns>'nonceExpectedValue' if a cookie is found that matches, null otherwise.</returns>
|
||||||
/// <remarks>Examins <see cref="HttpRequest.Cookies.Keys"/> that start with the prefix: 'OpenIdConnectAuthenticationDefaults.Nonce'.
|
/// <remarks>Examine <see cref="HttpRequest.Cookies.Keys"/> that start with the prefix: 'OpenIdConnectAuthenticationDefaults.Nonce'.
|
||||||
/// <see cref="OpenIdConnectAuthenticationOptions.StringDataFormat.Unprotect"/> is used to obtain the actual 'nonce'. If the nonce is found, then <see cref="HttpResponse.Cookies.Delete"/> is called.</remarks>
|
/// <see cref="OpenIdConnectAuthenticationOptions.StringDataFormat.Unprotect"/> is used to obtain the actual 'nonce'. If the nonce is found, then <see cref="HttpResponse.Cookies.Delete"/> is called.</remarks>
|
||||||
private string RetrieveNonce(string nonceExpectedValue)
|
private string RetrieveNonce(string nonceExpectedValue)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Security
|
||||||
/// Initializes a new instance of the <see cref="AuthenticationTicket"/> class
|
/// Initializes a new instance of the <see cref="AuthenticationTicket"/> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="identity">the <see cref="ClaimsPrincipal"/> that represents the authenticated user.</param>
|
/// <param name="identity">the <see cref="ClaimsPrincipal"/> that represents the authenticated user.</param>
|
||||||
/// <param name="properties">additional properties that can be consumed by the user or runtims.</param>
|
/// <param name="properties">additional properties that can be consumed by the user or runtime.</param>
|
||||||
/// <param name="authenticationType">the authentication middleware that was responsible for this ticket.</param>
|
/// <param name="authenticationType">the authentication middleware that was responsible for this ticket.</param>
|
||||||
public AuthenticationTicket(ClaimsPrincipal principal, AuthenticationProperties properties, string authenticationType)
|
public AuthenticationTicket(ClaimsPrincipal principal, AuthenticationProperties properties, string authenticationType)
|
||||||
{
|
{
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Security
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the authenticated user identity.
|
/// Gets the authentication type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string AuthenticationType { get; private set; }
|
public string AuthenticationType { get; private set; }
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNet.Security
|
||||||
public ClaimsIdentity Identity { get; private set; }
|
public ClaimsIdentity Identity { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the authenticated user identity.
|
/// Gets the claims-principal with authenticated user identities.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ClaimsPrincipal Principal{ get; private set; }
|
public ClaimsPrincipal Principal{ get; private set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNet.Http;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
using System;
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Security.Notifications
|
namespace Microsoft.AspNet.Security.Notifications
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue