[API Proposal]: AuthN/AuthZ metrics #59818
Labels
api-ready-for-review
API is ready for formal API review - https://github.com/dotnet/apireviews
area-auth
Includes: Authn, Authz, OAuth, OIDC, Bearer
feature-authentication
Milestone
Background and Motivation
This is a collection of metrics for ASP.NET Core Authentication and Authorization.
Implemented in #59557.
Proposed API
Microsoft.AspNetCore.Authentication
aspnetcore.authentication.request.duration
aspnetcore.authentication.request.duration
{request}
aspnetcore.authentication.scheme
Bearer
;Cookies
Conditionally Required
if the request did not end with an erroraspnetcore.authentication.result
success
;failure
;none
;_OTHER
Conditionally Required
if the request did not end with an errorerror.type
System.InvalidOperationException
;Contoso.MyException
Conditionally Required
if the request has ended with an erroraspnetcore.authentication.challenges
aspnetcore.authentication.challenges
{request}
aspnetcore.authentication.scheme
Bearer
;Cookies
Conditionally Required
if the request did not end with an errorerror.type
System.InvalidOperationException
;Contoso.MyException
Conditionally Required
if the request has ended with an erroraspnetcore.authentication.forbids
aspnetcore.authentication.forbids
{request}
aspnetcore.authentication.scheme
Bearer
;Cookies
Conditionally Required
if the request did not end with an errorerror.type
System.InvalidOperationException
;Contoso.MyException
Conditionally Required
if the request has ended with an erroraspnetcore.authentication.sign_ins
aspnetcore.authentication.sign_ins
{request}
aspnetcore.authentication.scheme
Bearer
;Cookies
Conditionally Required
if the request did not end with an errorerror.type
System.InvalidOperationException
;Contoso.MyException
Conditionally Required
if the request has ended with an erroraspnetcore.authentication.sign_outs
aspnetcore.authentication.sign_ins
{request}
aspnetcore.authentication.scheme
Bearer
;Cookies
Conditionally Required
if the request did not end with an errorerror.type
System.InvalidOperationException
;Contoso.MyException
Conditionally Required
if the request has ended with an errorMicrosoft.AspNetCore.Authorization
aspnetcore.authentication.requests
aspnetcore.authentication.requests
{request}
user.is_authenticated
true
Required
aspnetcore.authorization.policy
AtLeast21
;EmployeeOnly
Conditionally required
if an authorization policy is usedaspnetcore.authorization.result
success
;failure
Conditionally Required
if an exception is not thrown during authorizationerror.type
System.InvalidOperationException
;Contoso.MyException
Conditionally Required
if the request has ended with an errorThe text was updated successfully, but these errors were encountered: