名前空間: microsoft.graph
ID が使用されていない場合は、 authenticationContextClassReference オブジェクトを作成します。 ID が使用されている場合、この呼び出しによって authenticationContextClassReference オブジェクトが 更新されます。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
委任 (職場または学校のアカウント) |
AuthenticationContext.ReadWrite.All |
Policy.ReadWrite.ConditionalAccess |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
AuthenticationContext.ReadWrite.All |
Policy.ReadWrite.ConditionalAccess |
重要
サインインしているユーザーが別のユーザーを操作している職場または学校アカウントで委任されたシナリオでは、サポートされているMicrosoft Entraロールまたはサポートされているロールのアクセス許可を持つカスタム ロールを割り当てる必要があります。 この操作では、次の最小特権ロールがサポートされています。
HTTP 要求
PATCH /identity/conditionalAccess/authenticationContextClassReferences/{id}
名前 |
説明 |
Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、更新するプロパティの値 のみを 指定します。 要求本文に含まれていない既存のプロパティは、以前の値を維持するか、他のプロパティ値の変更に基づいて再計算されます。
次の表に、更新できるプロパティを示します。
プロパティ |
型 |
説明 |
displayName |
String |
表示名は、authenticationContextClassReference のフレンドリ名です。 この値は、ユーザー向けの管理者エクスペリエンスを構築するときに、認証コンテキスト クラス参照を識別するために使用する必要があります。 たとえば、選択 UX です。 |
説明 |
String |
authenticationContextClassReference によって適用されるポリシーの簡単な説明。 この値は、ユーザー向けの管理者エクスペリエンスを構築するときに認証コンテキスト クラス参照を記述するセカンダリ テキストを提供するために使用する必要があります。 たとえば、選択 UX です。 |
isAvailable |
ブール型 |
authenticationContextClassReference がセキュリティ管理者によって発行され、アプリで使用する準備ができているかどうかを示します。
false に設定されている場合は、認証コンテキストの選択 UX に表示したり、アプリ リソースを保護するために使用したりしないでください。 条件付きアクセス ポリシーの作成で表示され、使用できるようになります。 |
プロパティを持たない空の JSON オブジェクトを使用する要求では、指定された ID を持つオブジェクトが存在せず、プロパティがnull
設定されているか、既定値がある場合、新しい authenticationContextClassReference オブジェクトが作成されます。
応答
成功した場合、このメソッドは 204 No Content
応答コードを返します。 応答本文では何も返されません。
例
要求
次の例は要求を示しています。 ID c1
を持つオブジェクトが存在しない場合、この要求によって新しいオブジェクトが作成されます。オブジェクトが存在する場合、この要求は指定されたプロパティを更新します。
PATCH https://graph.microsoft.com/v1.0/identity/conditionalAccess/authenticationContextClassReferences/c1
Content-type: application/json
{
"displayName": "Contoso medium",
"description": "Medium protection level defined for Contoso policy",
"isAvailable": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AuthenticationContextClassReference
{
DisplayName = "Contoso medium",
Description = "Medium protection level defined for Contoso policy",
IsAvailable = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Identity.ConditionalAccess.AuthenticationContextClassReferences["{authenticationContextClassReference-id}"].PatchAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc identity conditional-access authentication-context-class-references patch --authentication-context-class-reference-id {authenticationContextClassReference-id} --body '{\
"displayName": "Contoso medium",\
"description": "Medium protection level defined for Contoso policy",\
"isAvailable": true\
}\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAuthenticationContextClassReference()
displayName := "Contoso medium"
requestBody.SetDisplayName(&displayName)
description := "Medium protection level defined for Contoso policy"
requestBody.SetDescription(&description)
isAvailable := true
requestBody.SetIsAvailable(&isAvailable)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationContextClassReferences, err := graphClient.Identity().ConditionalAccess().AuthenticationContextClassReferences().ByAuthenticationContextClassReferenceId("authenticationContextClassReference-id").Patch(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AuthenticationContextClassReference authenticationContextClassReference = new AuthenticationContextClassReference();
authenticationContextClassReference.setDisplayName("Contoso medium");
authenticationContextClassReference.setDescription("Medium protection level defined for Contoso policy");
authenticationContextClassReference.setIsAvailable(true);
AuthenticationContextClassReference result = graphClient.identity().conditionalAccess().authenticationContextClassReferences().byAuthenticationContextClassReferenceId("{authenticationContextClassReference-id}").patch(authenticationContextClassReference);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationContextClassReference = {
displayName: 'Contoso medium',
description: 'Medium protection level defined for Contoso policy',
isAvailable: true
};
await client.api('/identity/conditionalAccess/authenticationContextClassReferences/c1')
.update(authenticationContextClassReference);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AuthenticationContextClassReference;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AuthenticationContextClassReference();
$requestBody->setDisplayName('Contoso medium');
$requestBody->setDescription('Medium protection level defined for Contoso policy');
$requestBody->setIsAvailable(true);
$result = $graphServiceClient->identity()->conditionalAccess()->authenticationContextClassReferences()->byAuthenticationContextClassReferenceId('authenticationContextClassReference-id')->patch($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
displayName = "Contoso medium"
description = "Medium protection level defined for Contoso policy"
isAvailable = $true
}
Update-MgIdentityConditionalAccessAuthenticationContextClassReference -AuthenticationContextClassReferenceId $authenticationContextClassReferenceId -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.authentication_context_class_reference import AuthenticationContextClassReference
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AuthenticationContextClassReference(
display_name = "Contoso medium",
description = "Medium protection level defined for Contoso policy",
is_available = True,
)
result = await graph_client.identity.conditional_access.authentication_context_class_references.by_authentication_context_class_reference_id('authenticationContextClassReference-id').patch(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
次の例は応答を示しています。
HTTP/1.1 204 No Content