From 3ad4f685cd3335fbb881c69054ea9f8612dcf44a Mon Sep 17 00:00:00 2001 From: aaron-horst Date: Thu, 30 Oct 2014 23:03:04 -0400 Subject: [PATCH] Allow LinkedIn scopes to be overriden per request Allow customization of authentication scope via the properties dictionary for the challenge. Only when present will this override the scope set during startup. This will allow for different scopes in multi-function and tenant applications. --- .../LinkedIn/LinkedInAuthenticationHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Owin.Security.Providers/LinkedIn/LinkedInAuthenticationHandler.cs b/Owin.Security.Providers/LinkedIn/LinkedInAuthenticationHandler.cs index e686f8d..83aaa4c 100644 --- a/Owin.Security.Providers/LinkedIn/LinkedInAuthenticationHandler.cs +++ b/Owin.Security.Providers/LinkedIn/LinkedInAuthenticationHandler.cs @@ -171,6 +171,12 @@ namespace Owin.Security.Providers.LinkedIn // comma separated string scope = string.Join(",", Options.Scope); + // allow scopes to be specified via the authentication properties for this request, when specified they will already be comma separated + if (properties.Dictionary.ContainsKey("scope")) + { + scope = properties.Dictionary["scope"]; + } + string state = Options.StateDataFormat.Protect(properties); string authorizationEndpoint =