현재 세분화 된 인증에 대한 지원이 내장되어 있지 않습니다. 이것은 Functions UserVoice을위한 훌륭한 제안 항목이 될 것입니다.
내장 기능이 확실하게 우수 할지라도 권한 로직을 항상 함수의 일부로 작성할 수 있습니다. 아래 코드 스 니펫 (C#)은 코드의 인증 체크를 수행하고 클레임 목록을 인쇄합니다. 특정 소유권 주장이 필요하도록 수정할 수 있습니다.
using System.Net;
using System.Threading;
using System.Security.Claims;
public static void Run(HttpRequestMessage req, TraceWriter log)
{
if (!Thread.CurrentPrincipal.Identity.IsAuthenticated)
{
log.Info("Not authenticated");
return req.CreateResponse(HttpStatusCode.Unauthorized);
}
ClaimsIdentity identity = (Thread.CurrentPrincipal as ClaimsPrincipal)?.Identity as ClaimsIdentity;
if (identity != null)
{
foreach (var claim in identity.Claims)
{
log.Info($"{claim.Type} = {claim.Value}");
}
}
// Rest of your function...
return req.CreateResponse(HttpStatusCode.OK);
}
비영어권 언어에서는 소유권 주장 정보에 대한 헤더를 검사해야합니다. 또한 이것을 /.auth/me 끝점 및 공급자 그래프 끝점에 대한 호출과 결합 할 수 있습니다.
감사합니다. 제공된 링크에 제안 사항으로 게시 해 드리겠습니다. – Slicc