Validate OAuth authorization state (#1726)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
950ac7c1bc
commit
9c635ffed1
1 changed files with 170 additions and 26 deletions
|
|
@ -98,6 +98,7 @@ static async Task<AuthorizationResult?> HandleAuthorizationUrlAsync(
|
|||
var context = await listener.GetContextAsync();
|
||||
var query = HttpUtility.ParseQueryString(context.Request.Url?.Query ?? string.Empty);
|
||||
var code = query["code"];
|
||||
var state = query["state"];
|
||||
var iss = query["iss"];
|
||||
var error = query["error"];
|
||||
|
||||
|
|
@ -121,7 +122,7 @@ static async Task<AuthorizationResult?> HandleAuthorizationUrlAsync(
|
|||
}
|
||||
|
||||
Console.WriteLine("Authorization code received successfully.");
|
||||
return new AuthorizationResult { Code = code, Iss = iss };
|
||||
return new AuthorizationResult { Code = code, State = state, Iss = iss };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue