---
schema_version: "1"
id: 189d302d9340220e76cf96f129d29b6ac9f09658bc916efff3e5e705ffd0c5a0
title: TwoFactorInfo
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_twofactorinfo.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_twofactorinfo.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c7838c39b2e31dc51761d7135de1f3b687cd328cba85d8aec05195d7d5685af8
description: Stores a user’s secret for multi-factor operations. Use this object when customizing multi-factor authentication in your organization. (Note that multi-factor authentication was formerly called two-factor authentication.) This object is available in API version 32.0 and later.
---
# TwoFactorInfo

Stores a user’s secret for multi-factor operations. Use this object when customizing multi-factor authentication in your organization. (Note that multi-factor authentication was formerly called two-factor authentication.) This object is available in API version 32.0 and later.

## Supported Calls

create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()

## Special Access Rules

You need the Manage Multi-Factor Authentication in API permission to create or update this object.

## Fields

| Field Name | Details |
| --- | --- |
| SharedKey | 
Type

string

Properties

Create, Group, Sort, Update

Description

This field is never read-enabled, though it is write-enabled. A request for this value always returns null. The value must be a base32-encoded string of a 20-byte secret.

You can use the Apex method Auth.SessionManagement.getQrCode() to get a value to write to this field.

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

If you write a secret to this field, in API version 37.0 and later the user gets an email notification that a new identity verification method was added to the user’s account.

















 |
| Type | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

The multi-factor method.

- TOTP—The time-based one-time password.





 |
| UserId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID for the user who’s associated with the authentication secret.



 |