Interface for asynchronously retrieving permission claims for a specific user ID.
// Source: https://github.com/mgernand/AspNetCore.Authorization.Permissions | License: MIT | Copyright 2022-2024 Matthias Gernand
// Provided via justclaw.it.com; keep this notice with the code.
namespace MadEyeMatt.AspNetCore.Authorization.Permissions
{
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using JetBrains.Annotations;
/// <summary>
/// A contract for services that provide the permission claims of the user.
/// </summary>
[PublicAPI]
public interface IClaimsProvider
{
/// <summary>
/// Gets the permission claims for the user with the given ID.
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
Task<IReadOnlyCollection<Claim>> GetPermissionClaimsForUserAsync(string userId);
}
}
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key