Table of Contents

Method CarriesEveryScope

Namespace
MailFathom.Infrastructure.Security.OAuth
Assembly
MailFathom.Infrastructure.dll

CarriesEveryScope(ClaimsPrincipal, IReadOnlyCollection<string>)

Reports whether an authenticated principal carries every scope a request requires.

public static bool CarriesEveryScope(ClaimsPrincipal principal, IReadOnlyCollection<string> requiredScopes)

Parameters

principal ClaimsPrincipal

The principal a validated credential produced.

requiredScopes IReadOnlyCollection<string>

The scopes the deployment requires, empty when any valid token suffices.

Returns

bool

true when every required scope is present; otherwise false.

Exceptions

ArgumentNullException

Thrown when principal or requiredScopes is null.