phoneAuthenticationMethod:disableSmsSignIn
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
禁用现有电话号码的短信 mobile 登录。
注意: 此号码将不再可用于短信登录,从而可能阻止用户登录。
Permissions
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
自行操作的权限
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
UserAuthenticationMethod.ReadWrite |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| Application |
不支持。 |
对其他用户操作的权限
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
UserAuthenticationMethod.ReadWrite.All |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| Application |
UserAuthenticationMethod.ReadWrite.All |
对于管理员在另一用户上操作的委派方案,管理员需要以下角色Azure AD之一:
HTTP 请求
POST /me/authentication/phoneMethods/{id}/disableSmsSignIn
POST /users/{id | userPrincipalName}/authentication/phoneMethods/{id}/disableSmsSignIn
idphoneType 的 mobile 值为 3179e48a-750b-4051-897c-87b9720928f7 。
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法返回 200 OK 响应代码。它不在响应正文中返回任何内容。
示例
以下示例演示如何调用此 API。
请求
下面展示了示例请求。
POST https://graph.microsoft.com/beta/me/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7/disableSmsSignIn
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
await graphClient.Me.Authentication.PhoneMethods["{phoneAuthenticationMethod-id}"]
.DisableSmsSignIn()
.Request()
.PostAsync();
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/me/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7/disableSmsSignIn')
.version('beta')
.post();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/authentication/phoneMethods/3179e48a-750b-4051-897c-87b9720928f7/disableSmsSignIn"]]];
[urlRequest setHTTPMethod:@"POST"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
graphClient.me().authentication().phoneMethods("3179e48a-750b-4051-897c-87b9720928f7")
.disableSmsSignIn()
.buildRequest()
.post();
响应
下面展示了示例响应。
HTTP/1.1 200 OK