Changed BuildChallengeUrl in order to accept AuthorizationEndpoint which contains query parameters (#992)
This commit is contained in:
parent
0152691108
commit
ac773beffc
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue