Changed BuildChallengeUrl in order to accept AuthorizationEndpoint which contains query parameters (#992)

This commit is contained in:
Adem Caglin 2016-09-29 23:24:24 +03:00 committed by Chris R
parent 0152691108
commit ac773beffc
1 changed files with 3 additions and 3 deletions

View File

@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.Http.Features.Authentication;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Microsoft.AspNetCore.WebUtilities;
namespace Microsoft.AspNetCore.Authentication.OAuth namespace Microsoft.AspNetCore.Authentication.OAuth
{ {
@ -206,8 +207,7 @@ namespace Microsoft.AspNetCore.Authentication.OAuth
var scope = FormatScope(); var scope = FormatScope();
var state = Options.StateDataFormat.Protect(properties); var state = Options.StateDataFormat.Protect(properties);
var parameters = new Dictionary<string, string>
var queryBuilder = new QueryBuilder()
{ {
{ "client_id", Options.ClientId }, { "client_id", Options.ClientId },
{ "scope", scope }, { "scope", scope },
@ -215,7 +215,7 @@ namespace Microsoft.AspNetCore.Authentication.OAuth
{ "redirect_uri", redirectUri }, { "redirect_uri", redirectUri },
{ "state", state }, { "state", state },
}; };
return Options.AuthorizationEndpoint + queryBuilder.ToString(); return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, parameters);
} }
protected virtual string FormatScope() protected virtual string FormatScope()