From e00453af4dffdd861de65de88b4ecdfe8adc9e59 Mon Sep 17 00:00:00 2001 From: Mike Surcouf Date: Thu, 4 Feb 2016 09:08:03 +0000 Subject: [PATCH] Ensure scope has no duplicates --- src/Microsoft.AspNetCore.Authentication.OAuth/OAuthOptions.cs | 4 ++-- .../OpenIdConnectOptions.cs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Authentication.OAuth/OAuthOptions.cs b/src/Microsoft.AspNetCore.Authentication.OAuth/OAuthOptions.cs index a094e681ba..22d5e35573 100644 --- a/src/Microsoft.AspNetCore.Authentication.OAuth/OAuthOptions.cs +++ b/src/Microsoft.AspNetCore.Authentication.OAuth/OAuthOptions.cs @@ -56,9 +56,9 @@ namespace Microsoft.AspNetCore.Builder } /// - /// A list of permissions to request. + /// Gets the list of permissions to request. /// - public IList Scope { get; } = new List(); + public ICollection Scope { get; } = new HashSet(); /// /// Gets or sets the type used to secure data handled by the middleware. diff --git a/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectOptions.cs b/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectOptions.cs index 9e8eef1e19..de7bee1633 100644 --- a/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectOptions.cs +++ b/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectOptions.cs @@ -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"); } /// @@ -155,7 +157,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Gets the list of permissions to request. /// - public IList Scope { get; } = new List { "openid", "profile" }; + public ICollection Scope { get; } = new HashSet(); /// /// Gets or sets the type used to secure data handled by the middleware.