Class ProtectedResourceAttribute
- Namespace
- Keycloak.AuthServices.Authorization
- Assembly
- Keycloak.AuthServices.Authorization.dll
Specifies that the class or method that this attribute is applied to requires the specified authorization.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public sealed class ProtectedResourceAttribute : Attribute, IProtectedResourceData
- Inheritance
-
ProtectedResourceAttribute
- Implements
- Inherited Members
Constructors
ProtectedResourceAttribute(string, string?)
Initializes a new instance of the ProtectedResourceAttribute class with the specified policy.
public ProtectedResourceAttribute(string resource, string? scope = null)
Parameters
ProtectedResourceAttribute(string, string[])
Initializes a new instance of the ProtectedResourceAttribute class with the specified policy.
public ProtectedResourceAttribute(string resource, string[] scopes)
Parameters
Properties
Resource
Gets or sets resource name
public string Resource { get; }
Property Value
Scopes
Get or sets scopes
public string[]? Scopes { get; }
Property Value
- string[]