Skip to content

Commit

Permalink
Fix getting token from StringValues
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoogn committed Feb 17, 2024
1 parent ab45e93 commit 7f5b9cf
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ public Task<BearerTokenUsageTypeValidationResponse> ValidateAsync()
{
if (postForm.ContainsKey(Constants.AuthenticatedRequestScheme.FormEncodedBodyParameter))
{
var token = postForm.Where(x=>x.Key == Constants.AuthenticatedRequestScheme.AuthorizationRequestHeader)
.Select(x=>x.Value).First().ToString();
if(token is not null)
var token = postForm.Where(x => x.Key == Constants.AuthenticatedRequestScheme.AuthorizationRequestHeader)
.Select(x => x.Value).FirstOrDefault();
if(token.Count == 1)
{
response.Succeeded = true;
response.Token = token;
response.BearerTokenUsageType = Enumeration.BearerTokenUsageTypeEnum.FormEncodedBodyParameter;
return Task.FromResult(response);
string value = token;
if (value is not null)
{
response.Succeeded = true;
response.Token = value;
response.BearerTokenUsageType = Enumeration.BearerTokenUsageTypeEnum.FormEncodedBodyParameter;
return Task.FromResult(response);
}
}
}
}
Expand Down

0 comments on commit 7f5b9cf

Please sign in to comment.