RequiredScopeAttribute 클래스

정의

이 특성은 컨트롤러, 페이지 또는 컨트롤러 작업에서 웹 API에 필요한 범위를 선언(및 유효성 검사)하는 데 사용됩니다. 이러한 범위는 하드 코딩 또는 구성에서 선언하는 두 가지 방법으로 선언할 수 있습니다. 선택한 항목에 따라 생성자 중 하나 또는 다른 생성자를 사용합니다. 자세한 내용은 https://aka.ms/ms-id-web/required-scope-attribute참조하세요.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method)]
public class RequiredScopeAttribute : Attribute, Microsoft.Identity.Web.IAuthRequiredScopeMetadata
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method)>]
type RequiredScopeAttribute = class
    inherit Attribute
    interface IAuthRequiredScopeMetadata
Public Class RequiredScopeAttribute
Inherits Attribute
Implements IAuthRequiredScopeMetadata
상속
RequiredScopeAttribute
특성
구현

생성자

Name Description
RequiredScopeAttribute()

기본 생성자입니다.

RequiredScopeAttribute(String[])

웹 API가 올바른 범위로 호출되어 있는지 확인합니다. 이 API에 대해 가져온 토큰이 인증된 사용자를 대신하여 범위 클레임에 없는 acceptedScopes 경우 메서드는 상태 코드 403(금지됨)을 제공하는 HTTP 응답을 업데이트하고 토큰에 예상되는 범위를 알려주는 메시지를 응답 본문에 씁니다.

속성

Name Description
AcceptedScope

이 웹 API에서 허용하는 범위입니다.

IsReusable

사용되지 않음: 권한 부여 필터와 인터페이스의 호환성.

RequiredScopesConfigurationKey

필요한 범위를 포함하는 구성 키의 정규화된 이름입니다(공백으로 구분).

적용 대상