Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Aktualisieren sie die Eigenschaften eines qrCodePinAuthenticationMethodConfiguration-Objekts.
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
Policy.ReadWrite.AuthenticationMethod |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Anwendung |
Policy.ReadWrite.AuthenticationMethod |
Nicht verfügbar. |
Wichtig
Für den delegierten Zugriff mithilfe von Geschäfts-, Schul- oder Unikonten muss dem angemeldeten Benutzer eine unterstützte Microsoft Entra Rolle oder eine benutzerdefinierte Rolle zugewiesen werden, die die für diesen Vorgang erforderlichen Berechtigungen gewährt.
Der Authentifizierungsrichtlinienadministrator ist die Rolle mit den geringsten Berechtigungen, die für diesen Vorgang unterstützt wird.
HTTP-Anforderung
PATCH /policies/authenticationmethodspolicy/authenticationmethodconfigurations/qrcodepin
Anforderungstext
Geben Sie im Anforderungstext nur die Werte für zu aktualisierende Eigenschaften an. Vorhandene Eigenschaften, die nicht im Anforderungstext enthalten sind, behalten ihre vorherigen Werte bei oder werden basierend auf Änderungen an anderen Eigenschaftswerten neu berechnet.
In der folgenden Tabelle sind die Eigenschaften angegeben, die aktualisiert werden können.
| Eigenschaft |
Typ |
Beschreibung |
| state |
authenticationMethodState |
Gibt an, ob die Richtlinie aktiviert oder deaktiviert ist. Geerbt von microsoft.authMethodPolicy.authenticationMethodConfiguration. Die möglichen Werte sind: enabled, disabled. |
| excludeTargets |
microsoft.graph.excludeTarget-Sammlung |
Benutzer oder Gruppen, die von der Verwendung der QR-Code-Authentifizierungsmethode durch richtlinie ausgeschlossen sind. Geerbt von microsoft.authMethodPolicy.authenticationMethodConfiguration. |
| standardQRCodeLifetimeInDays |
Int32 |
Konfigurierte Lebensdauer des STANDARDMÄßIGEN QR-Codes für alle aktivierten Benutzer. Der Standardwert ist 365 Tage und die maximal zulässige Lebensdauer beträgt 395 Tage. |
| pinLength |
Int32 |
Die Standard- und Mindestlänge beträgt 8 Ziffern. Max. allowed ist bis zu 20 Ziffern. |
Antwort
Wenn die Methode erfolgreich verläuft, wird der Antwortcode 204 No Content zurückgegeben.
Beispiele
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PATCH https://graph.microsoft.com/beta/policies/authenticationmethodspolicy/authenticationmethodconfigurations/qrcodepin
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.qrCodePinAuthenticationMethodConfiguration",
"state": "enabled",
"standardQRCodeLifetimeInDays": 365,
"pinLength": 8
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new QrCodePinAuthenticationMethodConfiguration
{
OdataType = "#microsoft.graph.qrCodePinAuthenticationMethodConfiguration",
State = AuthenticationMethodState.Enabled,
StandardQRCodeLifetimeInDays = 365,
PinLength = 8,
};
// To initialize your graphClient, see https://dotnet.territoriali.olinfo.it/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Policies.AuthenticationMethodsPolicy.AuthenticationMethodConfigurations["{authenticationMethodConfiguration-id}"].PatchAsync(requestBody);
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewAuthenticationMethodConfiguration()
state := graphmodels.ENABLED_AUTHENTICATIONMETHODSTATE
requestBody.SetState(&state)
standardQRCodeLifetimeInDays := int32(365)
requestBody.SetStandardQRCodeLifetimeInDays(&standardQRCodeLifetimeInDays)
pinLength := int32(8)
requestBody.SetPinLength(&pinLength)
// To initialize your graphClient, see https://dotnet.territoriali.olinfo.it/en-us/graph/sdks/create-client?from=snippets&tabs=go
authenticationMethodConfigurations, err := graphClient.Policies().AuthenticationMethodsPolicy().AuthenticationMethodConfigurations().ByAuthenticationMethodConfigurationId("authenticationMethodConfiguration-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
QrCodePinAuthenticationMethodConfiguration authenticationMethodConfiguration = new QrCodePinAuthenticationMethodConfiguration();
authenticationMethodConfiguration.setOdataType("#microsoft.graph.qrCodePinAuthenticationMethodConfiguration");
authenticationMethodConfiguration.setState(AuthenticationMethodState.Enabled);
authenticationMethodConfiguration.setStandardQRCodeLifetimeInDays(365);
authenticationMethodConfiguration.setPinLength(8);
AuthenticationMethodConfiguration result = graphClient.policies().authenticationMethodsPolicy().authenticationMethodConfigurations().byAuthenticationMethodConfigurationId("{authenticationMethodConfiguration-id}").patch(authenticationMethodConfiguration);
const options = {
authProvider,
};
const client = Client.init(options);
const authenticationMethodConfiguration = {
'@odata.type': '#microsoft.graph.qrCodePinAuthenticationMethodConfiguration',
state: 'enabled',
standardQRCodeLifetimeInDays: 365,
pinLength: 8
};
await client.api('/policies/authenticationmethodspolicy/authenticationmethodconfigurations/qrcodepin')
.version('beta')
.update(authenticationMethodConfiguration);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\QrCodePinAuthenticationMethodConfiguration;
use Microsoft\Graph\Beta\Generated\Models\AuthenticationMethodState;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new QrCodePinAuthenticationMethodConfiguration();
$requestBody->setOdataType('#microsoft.graph.qrCodePinAuthenticationMethodConfiguration');
$requestBody->setState(new AuthenticationMethodState('enabled'));
$requestBody->setStandardQRCodeLifetimeInDays(365);
$requestBody->setPinLength(8);
$result = $graphServiceClient->policies()->authenticationMethodsPolicy()->authenticationMethodConfigurations()->byAuthenticationMethodConfigurationId('authenticationMethodConfiguration-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
"@odata.type" = "#microsoft.graph.qrCodePinAuthenticationMethodConfiguration"
state = "enabled"
standardQRCodeLifetimeInDays =
pinLength =
}
Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $authenticationMethodConfigurationId -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.models.qr_code_pin_authentication_method_configuration import QrCodePinAuthenticationMethodConfiguration
from msgraph_beta.generated.models.authentication_method_state import AuthenticationMethodState
# To initialize your graph_client, see https://dotnet.territoriali.olinfo.it/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = QrCodePinAuthenticationMethodConfiguration(
odata_type = "#microsoft.graph.qrCodePinAuthenticationMethodConfiguration",
state = AuthenticationMethodState.Enabled,
standard_q_r_code_lifetime_in_days = 365,
pin_length = 8,
)
result = await graph_client.policies.authentication_methods_policy.authentication_method_configurations.by_authentication_method_configuration_id('authenticationMethodConfiguration-id').patch(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 204 No Content