Skip to main content

mfa_totp_devices

Creates, updates, deletes, gets or lists a mfa_totp_devices resource.

Overview​

Namemfa_totp_devices
TypeResource
Idoci.identity.mfa_totp_devices

Fields​

The following fields are returned by SELECT queries:

The MFA TOTP device.

NameDatatypeDescription
idstringThe OCID of the MFA TOTP Device.
inactiveStatusinteger (int64)The detailed status of INACTIVE lifecycleState. Allowed values are: - 1 - SUSPENDED - 2 - DISABLED - 4 - BLOCKED - 8 - LOCKED
isActivatedbooleanFlag to indicate if the MFA TOTP device has been activated
lifecycleStatestringThe MFA TOTP device's current state. (CREATING, ACTIVE, INACTIVE, DELETING, DELETED)
timeCreatedstring (date-time)Date and time the MfaTotpDevice object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpiresstring (date-time)Date and time when this MFA TOTP device will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
userIdstringThe OCID of the user the MFA TOTP device belongs to.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectuserId, mfaTotpDeviceId, regionGet the specified MFA TOTP device for the specified user.<br />
listselectuserId, regionpage, limit, sortBy, sortOrderLists the MFA TOTP devices for the specified user. The returned object contains the device's OCID, but not<br />the seed. The seed is returned only upon creation or when the IAM service regenerates the MFA seed for the device.<br />
createinsertuserId, regionopc-retry-tokenCreates a new MFA TOTP device for the user. A user can have one MFA TOTP device.<br />
deletedeleteuserId, mfaTotpDeviceId, regionif-matchDeletes the specified MFA TOTP device for the specified user.<br />
activate_mfa_totp_deviceexecuserId, mfaTotpDeviceId, regionif-match, opc-retry-tokenActivates the specified MFA TOTP device for the user. Activation requires manual interaction with the Console.<br />
generate_totp_seedexecuserId, mfaTotpDeviceId, regionif-matchGenerate seed for the MFA TOTP device.<br />

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.

NameDatatypeDescription
mfaTotpDeviceIdstringThe OCID of the MFA TOTP device.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
userIdstringThe OCID of the user.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
limitintegerThe maximum number of items to return in a paginated "List" call.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringThe value of the opc-next-page response header from the previous "List" call.
sortBystringThe field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. Note: In general, some "List" operations (for example, ListInstances) let you optionally filter by Availability Domain if the scope of the resource type is within a single Availability Domain. If you call one of these "List" operations without specifying an Availability Domain, the resources are grouped by Availability Domain, then sorted.
sortOrderstringThe sort order to use, either ascending (ASC) or descending (DESC). The NAME sort order is case sensitive.

SELECT examples​

Get the specified MFA TOTP device for the specified user.<br />

SELECT
id,
inactiveStatus,
isActivated,
lifecycleState,
timeCreated,
timeExpires,
userId
FROM oci.identity.mfa_totp_devices
WHERE userId = '{{ userId }}' -- required
AND mfaTotpDeviceId = '{{ mfaTotpDeviceId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a new MFA TOTP device for the user. A user can have one MFA TOTP device.<br />

INSERT INTO oci.identity.mfa_totp_devices (
userId,
region,
opc-retry-token
)
SELECT
'{{ userId }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
inactiveStatus,
isActivated,
lifecycleState,
seed,
timeCreated,
timeExpires,
userId
;

DELETE examples​

Deletes the specified MFA TOTP device for the specified user.<br />

DELETE FROM oci.identity.mfa_totp_devices
WHERE userId = '{{ userId }}' --required
AND mfaTotpDeviceId = '{{ mfaTotpDeviceId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;

Lifecycle Methods​

Activates the specified MFA TOTP device for the user. Activation requires manual interaction with the Console.<br />

EXEC oci.identity.mfa_totp_devices.activate_mfa_totp_device
@userId='{{ userId }}' --required,
@mfaTotpDeviceId='{{ mfaTotpDeviceId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"totpToken": "{{ totpToken }}"
}'
;