---
schema_version: "1"
id: 0f27fd8b2f836369d7a6154b516b140244ddcd0d38a9813a47945d52c6564b87
title: IdentityType Enum
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_enum_DataSource_IdentityType.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_DataSource_IdentityType.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1a868595436eb791631dcaa812101ce4a8ee298703ec635d8d52a5d820d8f425
description: Determines which set of credentials is used to authenticate to the external system.
---
# IdentityType Enum

Determines which set of credentials is used to authenticate to the external system.

## Usage

The relevant credentials are passed to your [DataSource.Connection](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_Connection.htm#apex_class_DataSource_Connection "Extend this class to enable your Salesforce org to sync the external system’s schema and to handle queries, searches, and write operations (upsert and delete) of the external data. This class extends the DataSourceUtil class and inherits its methods.") class.

## Enum Values

The following are the values of the DataSource.IdentityType enum.

<table class="featureTable sort_table" summary="">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d1290515e75">Value</th>

              <th class="featureTableHeader  " id="d1290515e78">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d1290515e75" data-title="Value"><samp class="codeph apex_code">ANONYMOUS</samp></td>

              <td class="entry" headers="d1290515e78" data-title="Description">No credentials are used to authenticate to the external system.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1290515e75" data-title="Value"><samp class="codeph apex_code">NAMED_USER</samp></td>

              <td class="entry" headers="d1290515e78" data-title="Description">The credentials in the external data source definition are used to authenticate
                to the external system, regardless of which user is accessing the external data from
                your organization.</td>

            </tr>

            <tr>
              <td class="entry" headers="d1290515e75" data-title="Value"><samp class="codeph apex_code">PER_USER</samp></td>

              <td class="entry" headers="d1290515e78" data-title="Description">For queries and searches, the credentials are specific to the current user who
                invokes the query or search. The credentials come from the user’s authentication
                settings for the external system.<p class="p">For administrative connections, such as syncing
                  the external system’s schema, the credentials come from the external data source
                  definition.</p>
              </td>

            </tr>

          </tbody>

        </table>