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