mirror of
https://github.com/farcasclaudiu/AzureStaticWebApp-CSharp-SimpleDemo.git
synced 2026-06-22 07:01:03 +03:00
bring code in
This commit is contained in:
+1
-15
@@ -20,21 +20,7 @@ namespace demo.Function
|
||||
ClaimsPrincipal principal)
|
||||
{
|
||||
log.LogInformation("C# HTTP trigger function processed a request.");
|
||||
bool isClaimValid = true;
|
||||
string userId = string.Empty;
|
||||
|
||||
if (principal == null)
|
||||
{
|
||||
log.LogWarning("No principal.");
|
||||
isClaimValid = false;
|
||||
}
|
||||
|
||||
if(isClaimValid)
|
||||
{
|
||||
userId = principal.FindFirst(ClaimTypes.GivenName).Value;
|
||||
log.LogInformation("Authenticated user {user}.", userId);
|
||||
}
|
||||
|
||||
|
||||
string name = req.Query["name"];
|
||||
|
||||
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
|
||||
|
||||
Reference in New Issue
Block a user