Em cenários delegados com contas escolares ou profissionais, o utilizador com sessão iniciada tem de ter uma função suportada do Microsoft Entra ou uma função personalizada com uma permissão de função suportada. As seguintes funções com menos privilégios são suportadas para esta operação.
Leitor Global
Administrador de Autenticação
Administrador de Autenticação Privilegiada
Solicitação HTTP
Obtenha os detalhes do seu próprio método de autenticação de token OATH de software.
GET /me/authentication/softwareOathMethods/{id}
Obtenha detalhes do seu próprio método de autenticação de token OATH de software ou de outro utilizador.
GET /users/{id | userPrincipalName}/authentication/softwareOathMethods/{id}
GET https://graph.microsoft.com/v1.0/me/authentication/softwareOathMethods/b172893e-893e-b172-3e89-72b13e8972b1
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Authentication.SoftwareOathMethods["{softwareOathAuthenticationMethod-id}"].GetAsync();
// 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"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
softwareOathMethods, err := graphClient.Me().Authentication().SoftwareOathMethods().BySoftwareOathAuthenticationMethodId("softwareOathAuthenticationMethod-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
SoftwareOathAuthenticationMethod result = graphClient.me().authentication().softwareOathMethods().bySoftwareOathAuthenticationMethodId("{softwareOathAuthenticationMethod-id}").get();
Import-Module Microsoft.Graph.Identity.SignIns
# A UPN can also be used as -UserId.
Get-MgUserAuthenticationSoftwareOathMethod -UserId $userId -SoftwareOathAuthenticationMethodId $softwareOathAuthenticationMethodId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.me.authentication.software_oath_methods.by_software_oath_authentication_method_id('softwareOathAuthenticationMethod-id').get()