authentication_phone_methods
Creates, updates, deletes, gets or lists an authentication_phone_methods resource.
Overview
| Name | authentication_phone_methods |
| Type | Resource |
| Id | entra_id.users.authentication_phone_methods |
Fields
The following fields are returned by SELECT queries:
- get
- list
Retrieved navigation property
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for an entity. Read-only. |
createdDateTime | string (date-time) | Represents the date and time when an entity was created. Read-only. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$) |
phoneNumber | string | The phone number to text or call for authentication. Phone numbers use the format +{country code} {number}x{extension}, with extension optional. For example, +1 5555551234 or +1 5555551234x123 are valid. Numbers are rejected when creating or updating if they don't match the required format. |
phoneType | | The type of this phone. The possible values are: mobile, alternateMobile, or office. |
smsSignInState | | Whether a phone is ready to be used for SMS sign-in or not. The possible values are: notSupported, notAllowedByPolicy, notEnabled, phoneNumberNotUnique, ready, or notConfigured, unknownFutureValue. |
Retrieved collection
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for an entity. Read-only. |
createdDateTime | string (date-time) | Represents the date and time when an entity was created. Read-only. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$) |
phoneNumber | string | The phone number to text or call for authentication. Phone numbers use the format +{country code} {number}x{extension}, with extension optional. For example, +1 5555551234 or +1 5555551234x123 are valid. Numbers are rejected when creating or updating if they don't match the required format. |
phoneType | | The type of this phone. The possible values are: mobile, alternateMobile, or office. |
smsSignInState | | Whether a phone is ready to be used for SMS sign-in or not. The possible values are: notSupported, notAllowedByPolicy, notEnabled, phoneNumberNotUnique, ready, or notConfigured, unknownFutureValue. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | user_id, phone_authentication_method_id | The phone numbers registered to a user for authentication. | |
list | select | user_id | The phone numbers registered to a user for authentication. | |
insert | insert | user_id | Add a new phone authentication method for a user. A user may only have one phone of each type, captured in the phoneType property. This means, for example, adding a mobile phone to a user with a pre-existing mobile phone fails. Additionally, a user must always have a mobile phone before adding an alternateMobile phone. Adding a phone number makes it available for use in both Azure multi-factor authentication (MFA) and self-service password reset (SSPR), if enabled. Additionally, if a user is enabled by policy to use SMS sign-in and a mobile number is added, the system attempts to register the number for use in that system. | |
update | update | user_id, phone_authentication_method_id | Update a user's phone number associated with a phone authentication method object. You can't change a phone's type. To change a phone's type, add a new number of the desired type and then delete the object with the original type. If a user is enabled by policy to use SMS to sign in and the mobile number is changed, the system will attempt to register the number for use in that system. Self-service operations aren't supported. | |
delete | delete | user_id, phone_authentication_method_id | If-Match | |
disable_sms_sign_in | exec | user_id, phone_authentication_method_id | Disable SMS sign-in for an existing mobile phone number registered to a user. The number will no longer be available for SMS sign-in, which can prevent your user from signing in. | |
enable_sms_sign_in | exec | user_id, phone_authentication_method_id | Enable SMS sign-in for an existing mobile phone number registered to a user. To be successfully enabled: |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
phone_authentication_method_id | string | The unique identifier of phoneAuthenticationMethod |
user_id | string | The unique identifier of user |
If-Match | string | ETag |
SELECT examples
- get
- list
The phone numbers registered to a user for authentication.
SELECT
id,
createdDateTime,
phoneNumber,
phoneType,
smsSignInState
FROM entra_id.users.authentication_phone_methods
WHERE user_id = '{{ user_id }}' -- required
AND phone_authentication_method_id = '{{ phone_authentication_method_id }}' -- required
;
The phone numbers registered to a user for authentication.
SELECT
id,
createdDateTime,
phoneNumber,
phoneType,
smsSignInState
FROM entra_id.users.authentication_phone_methods
WHERE user_id = '{{ user_id }}' -- required
;
INSERT examples
- insert
- Manifest
Add a new phone authentication method for a user. A user may only have one phone of each type, captured in the phoneType property. This means, for example, adding a mobile phone to a user with a pre-existing mobile phone fails. Additionally, a user must always have a mobile phone before adding an alternateMobile phone. Adding a phone number makes it available for use in both Azure multi-factor authentication (MFA) and self-service password reset (SSPR), if enabled. Additionally, if a user is enabled by policy to use SMS sign-in and a mobile number is added, the system attempts to register the number for use in that system.
INSERT INTO entra_id.users.authentication_phone_methods (
id,
createdDateTime,
phoneNumber,
phoneType,
smsSignInState,
user_id
)
SELECT
'{{ id }}',
'{{ createdDateTime }}',
'{{ phoneNumber }}',
'{{ phoneType }}',
'{{ smsSignInState }}',
'{{ user_id }}'
RETURNING
id,
createdDateTime,
phoneNumber,
phoneType,
smsSignInState
;
# Description fields are for documentation purposes
- name: authentication_phone_methods
props:
- name: user_id
value: "{{ user_id }}"
description: Required parameter for the authentication_phone_methods resource.
- name: id
value: "{{ id }}"
description: |
The unique identifier for an entity. Read-only.
- name: createdDateTime
value: "{{ createdDateTime }}"
description: |
Represents the date and time when an entity was created. Read-only.
- name: phoneNumber
value: "{{ phoneNumber }}"
description: |
The phone number to text or call for authentication. Phone numbers use the format +{country code} {number}x{extension}, with extension optional. For example, +1 5555551234 or +1 5555551234x123 are valid. Numbers are rejected when creating or updating if they don't match the required format.
- name: phoneType
value: "{{ phoneType }}"
description: |
The type of this phone. The possible values are: mobile, alternateMobile, or office.
- name: smsSignInState
value: "{{ smsSignInState }}"
description: |
Whether a phone is ready to be used for SMS sign-in or not. The possible values are: notSupported, notAllowedByPolicy, notEnabled, phoneNumberNotUnique, ready, or notConfigured, unknownFutureValue.
UPDATE examples
- update
Update a user's phone number associated with a phone authentication method object. You can't change a phone's type. To change a phone's type, add a new number of the desired type and then delete the object with the original type. If a user is enabled by policy to use SMS to sign in and the mobile number is changed, the system will attempt to register the number for use in that system. Self-service operations aren't supported.
UPDATE entra_id.users.authentication_phone_methods
SET
id = '{{ id }}',
createdDateTime = '{{ createdDateTime }}',
phoneNumber = '{{ phoneNumber }}',
phoneType = '{{ phoneType }}',
smsSignInState = '{{ smsSignInState }}'
WHERE
user_id = '{{ user_id }}' --required
AND phone_authentication_method_id = '{{ phone_authentication_method_id }}' --required
RETURNING
id,
createdDateTime,
phoneNumber,
phoneType,
smsSignInState;
DELETE examples
- delete
No description available.
DELETE FROM entra_id.users.authentication_phone_methods
WHERE user_id = '{{ user_id }}' --required
AND phone_authentication_method_id = '{{ phone_authentication_method_id }}' --required
AND If-Match = '{{ If-Match }}'
;
Lifecycle Methods
- disable_sms_sign_in
- enable_sms_sign_in
Disable SMS sign-in for an existing mobile phone number registered to a user. The number will no longer be available for SMS sign-in, which can prevent your user from signing in.
EXEC entra_id.users.authentication_phone_methods.disable_sms_sign_in
@user_id='{{ user_id }}' --required,
@phone_authentication_method_id='{{ phone_authentication_method_id }}' --required
;
Enable SMS sign-in for an existing mobile phone number registered to a user. To be successfully enabled:
EXEC entra_id.users.authentication_phone_methods.enable_sms_sign_in
@user_id='{{ user_id }}' --required,
@phone_authentication_method_id='{{ phone_authentication_method_id }}' --required
;