Ensure scope has no duplicates

This commit is contained in:
Mike Surcouf 2016-02-04 09:08:03 +00:00
parent e737f3207e
commit e00453af4d
2 changed files with 5 additions and 3 deletions

View File

@ -56,9 +56,9 @@ namespace Microsoft.AspNetCore.Builder
} }
/// <summary> /// <summary>
/// A list of permissions to request. /// Gets the list of permissions to request.
/// </summary> /// </summary>
public IList<string> Scope { get; } = new List<string>(); public ICollection<string> Scope { get; } = new HashSet<string>();
/// <summary> /// <summary>
/// Gets or sets the type used to secure data handled by the middleware. /// Gets or sets the type used to secure data handled by the middleware.

View File

@ -53,6 +53,8 @@ namespace Microsoft.AspNetCore.Builder
DisplayName = OpenIdConnectDefaults.Caption; DisplayName = OpenIdConnectDefaults.Caption;
CallbackPath = new PathString("/signin-oidc"); CallbackPath = new PathString("/signin-oidc");
Events = new OpenIdConnectEvents(); Events = new OpenIdConnectEvents();
Scope.Add("openid");
Scope.Add("profile");
} }
/// <summary> /// <summary>
@ -155,7 +157,7 @@ namespace Microsoft.AspNetCore.Builder
/// <summary> /// <summary>
/// Gets the list of permissions to request. /// Gets the list of permissions to request.
/// </summary> /// </summary>
public IList<string> Scope { get; } = new List<string> { "openid", "profile" }; public ICollection<string> Scope { get; } = new HashSet<string>();
/// <summary> /// <summary>
/// Gets or sets the type used to secure data handled by the middleware. /// Gets or sets the type used to secure data handled by the middleware.