名前空間: microsoft.graph
重要
Microsoft Graph の /beta
バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
ユーザーまたはグループのパスワードを使用して、シングル サインオン資格情報の一覧を取得します。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
委任 (職場または学校のアカウント) |
Application.ReadWrite.All および Directory.Read.All |
Directory.ReadWrite.All |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
Application.ReadWrite.OwnedBy と Directory.Read.All |
Directory.Read.All と Application.ReadWrite.All、Directory.ReadWrite.All |
重要
職場または学校アカウントを使用した委任されたシナリオでは、サインインしているユーザーに、サポートされているMicrosoft Entraロールまたはサポートされているロールのアクセス許可を持つカスタム ロールを割り当てる必要があります。 この操作では、次の最小特権ロールがサポートされています。
- ユーザーは自分で資格情報を作成および管理できます
- アプリケーション管理者
- クラウド アプリケーション管理者
HTTP 要求
サービス プリンシパルは、 その ID または appId を使用してアドレス指定できます。
id と appId は、Microsoft Entra 管理センターのアプリ登録でそれぞれオブジェクト ID とアプリケーション (クライアント) ID と呼ばれます。
POST /servicePrincipals/{id}/getPasswordSingleSignOnCredentials
POST /servicePrincipals(appId='{appId}')/getPasswordSingleSignOnCredentials
名前 |
説明 |
Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、次のパラメーターを含む JSON オブジェクトを指定します。
パラメーター |
型 |
説明 |
id |
String |
この資格情報セットが属するユーザーまたはグループの ID。 |
応答
成功した場合、このメソッドは 200 OK
応答コードと、応答本文に新しい passwordSingleSignOnCredentialSet オブジェクトを返します。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/beta/servicePrincipals/{id}/getPasswordSingleSignOnCredentials
Content-type: application/json
{
"id": "5793aa3b-cca9-4794-679a240f8b58"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.ServicePrincipals.Item.GetPasswordSingleSignOnCredentials;
var requestBody = new GetPasswordSingleSignOnCredentialsPostRequestBody
{
Id = "5793aa3b-cca9-4794-679a240f8b58",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.ServicePrincipals["{servicePrincipal-id}"].GetPasswordSingleSignOnCredentials.PostAsync(requestBody);
mgc-beta service-principals get-password-single-sign-on-credentials post --service-principal-id {servicePrincipal-id} --body '{\
"id": "5793aa3b-cca9-4794-679a240f8b58"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphserviceprincipals "github.com/microsoftgraph/msgraph-beta-sdk-go/serviceprincipals"
//other-imports
)
requestBody := graphserviceprincipals.NewGetPasswordSingleSignOnCredentialsPostRequestBody()
id := "5793aa3b-cca9-4794-679a240f8b58"
requestBody.SetId(&id)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
getPasswordSingleSignOnCredentials, err := graphClient.ServicePrincipals().ByServicePrincipalId("servicePrincipal-id").GetPasswordSingleSignOnCredentials().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.serviceprincipals.item.getpasswordsinglesignoncredentials.GetPasswordSingleSignOnCredentialsPostRequestBody getPasswordSingleSignOnCredentialsPostRequestBody = new com.microsoft.graph.beta.serviceprincipals.item.getpasswordsinglesignoncredentials.GetPasswordSingleSignOnCredentialsPostRequestBody();
getPasswordSingleSignOnCredentialsPostRequestBody.setId("5793aa3b-cca9-4794-679a240f8b58");
var result = graphClient.servicePrincipals().byServicePrincipalId("{servicePrincipal-id}").getPasswordSingleSignOnCredentials().post(getPasswordSingleSignOnCredentialsPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const passwordSingleSignOnCredentialSet = {
id: '5793aa3b-cca9-4794-679a240f8b58'
};
await client.api('/servicePrincipals/{id}/getPasswordSingleSignOnCredentials')
.version('beta')
.post(passwordSingleSignOnCredentialSet);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\ServicePrincipals\Item\GetPasswordSingleSignOnCredentials\GetPasswordSingleSignOnCredentialsPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GetPasswordSingleSignOnCredentialsPostRequestBody();
$requestBody->setId('5793aa3b-cca9-4794-679a240f8b58');
$result = $graphServiceClient->servicePrincipals()->byServicePrincipalId('servicePrincipal-id')->getPasswordSingleSignOnCredentials()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Applications
$params = @{
id = "5793aa3b-cca9-4794-679a240f8b58"
}
Get-MgBetaServicePrincipalPasswordSingleSignOnCredential -ServicePrincipalId $servicePrincipalId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.serviceprincipals.item.get_password_single_sign_on_credentials.get_password_single_sign_on_credentials_post_request_body import GetPasswordSingleSignOnCredentialsPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GetPasswordSingleSignOnCredentialsPostRequestBody(
id = "5793aa3b-cca9-4794-679a240f8b58",
)
result = await graph_client.service_principals.by_service_principal_id('servicePrincipal-id').get_password_single_sign_on_credentials.post(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"id": "5793aa3b-cca9-4794-679a240f8b58",
"credentials": [
{
"fieldId": "param_username",
"value": "myusername",
"type": "username"
},
{
"fieldId": "param_password",
"value": null,
"type": "password"
}
]
}