Note: Nintex Apps data centers are located in West US and Australia (AUS). In-region processing of Nintex Apps data is only available in these regions.

Authentication and Nintex Apps

Nintex Apps provides several different mechanisms for authenticating to external services. You can choose to store (shared and/or individual) credentials securely within Salesforce, or you can choose to leverage standards like OAuth to delegate authentication to a third party.

Connection Authentication Methods

These authentication methods are available at the connection level.

No Authentication

Select this option if your service is publicly available and does not need any type of credentials for access. This method could also be relevant for services that are behind a firewall and the connection has Use Apex Proxy unchecked.

Basic HTTP Authentication

While OAuth is the recommended authentication flow for most connections, Nintex Apps also allows for basic HTTP authentication—in short, sending encrypted user credentials to a connection to login.

Nintex Apps encrypts all usernames and passwords using AES-256 symmetric encryption. Credential records are stored in Protected Custom Settings which are inaccessible to querying through any API—only Nintex Apps internal code can access this information, and Nintex Apps does so only when making authentication requests to connections. Your company's Salesforce administrator can change the encryption key from the Nintex Settings page.

Note:  It is impossible for Nintex Apps administrators to login as a different end user and gain access to that user's connection credentials.

With Basic HTTP Authentication, credentials are sent Base64 encoded as a header with every request. If you select this authentication method, Nintex Apps will automatically construct the Authorization as shown below. For example, if a username of Aladdin and a password of open sesame were provided, Nintex Apps would construct the following header.

Copy
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

When configuring basic HTTP authentication for a connection, you must specify a credential source. This can either be:

  • Shared by all Site Users ( Nintex Apps ) / Shared Org-wide ( Nintex Apps for Salesforce ): If you want all end users to share the same username and password to access the external data system, select this option and enter the credentials on the form that appears below the picklist.
  • Shared Per-Profile, with optional Org-wide Defaults: If you want end users to share a login based on a Salesforce profile, enter the credentials on the form that appears below the picklist. You may also enter default org-wide credentials.

Note:  This credential source is not currently available on Nintex Apps.

  • Per-User, with optional shared Site-wide Defaults ( Nintex Apps ) / Per-User, with optional Profile / Org-wide Defaults ( Nintex Apps for Salesforce ): Allows users to enter their own individual credentials for a connection, with optional default credentials available if needed.

    End users manually add their own credentials within the Nintex Apps UI:

API Key Authentication

Some services authenticate by requiring a special key be passed along in each request—this key being associated with certain permissions in the service. By selecting this authentication type, the API key field appears, which stores the given API key as an encrypted piece of data in Nintex Apps. This key can then be used within any common HTTP header or body request data for the connection—where it will be securely injected server-side to prevent end users from seeing the key should they observe their network traffic.

  • API key: The key to store

Once entered and saved, use the {{$Auth.API_Key}} merge variable to set up a common request header or body data in the format required by the service.

Note:  This authentication method requires the use of Nintex Apps's proxy.

Example

Assume a service requires an API key be sent with as an Authorization header with this format:

Copy
Authorization: Bearer <API_KEY>

Also assume the API key's value is abc123 .

To authenticate to this service using API key authentication:

  1. Create a new connection (or open an existing one).
  2. Set the authentication method to API Key Authentication.
  3. In the API key field, enter the API key: abc123 .
  4. Click Save.

Now you can use the {{$Auth.API_Key}} merge variable in a common request header matching the service's API reference material.

  1. Click Common HTTP Request Data.

  2. In the Common request headers section, click the box icon in the object, then click Append.

  3. Add a key-value pair that includes the $Auth merge variable:

    Authorization: Bearer {{$Auth.API_Key}}

  4. Click Save

Now, when a Nintex Apps model makes a request to this connection's service, the Authorization header will appear on the request. To end users, this header's value appears as Bearer {{$Auth.API_Key}} . However, when making the request, Nintex Apps's proxy securely injects the true value.

Separate Authentication URL

With the Separate Authentication URL option, Nintex Apps will first make a request to a separate authentication URL, which is expected to return an access token after successfully authenticating. This token can then be used on subsequent requests by updating the connection's Common request headers and/or Common request body data to use the {{$Auth.Response.Body}} and {{$Auth.Response.Headers}} merge variables. You can also access nested parameters/headers through those merge variables. For more information, see the Authentication Merge Variables section

When configuring a Separate Authentication, you can (but are not required to) specify a credential source. This can either be Shared: Org-Wide, Shared: Per-Profile, or Per-User.

  • If the Shared: Org-Wide setting is selected, then you will be prompted to enter the shared username and password.
  • If the Per-Profile, or Per-User settings are selected, then the credentials need to be entered on a separate screen.

Authentication Provider (OAuth, Custom, etc.)

Authentication Providers in Nintex Apps allow for the use of specialized protocols (like OAuth) or custom Apex Code to handle Authentication. Using Authentication Providers, Admins can configure OAuth connections or Custom Apex code.

Authentication Provider Authentication Methods

The following methods require the use of connection in conjunction with an authentication provider.

Custom Apex Authentication

This option is currently only used internally to support the Sharepoint connector's custom authentication process.

OAuth 2.0 / Open ID

OAuth is an open source standard for authentication. It allows a third party ( Nintex Apps ) to create models on services where Nintex Apps never actually receives or knows the username or password required to access that service. The OAuth spec describes several different grant types (or flows) that can be used to gain access to a resource server (External Web Service).

Important:  Nintex Apps does not currently support authenticating with OAuth 1.

Additional resources

OAuth Grant Type Authentication Flows

When configuring authentication providers, there are several grant types to choose from. Depending on your choice, end users will go through a different authentication flow when they attempt to use a connection.

Troubleshooting Tips for Authentication

To troubleshoot OAuth issues, you can use Nintex Apps's Javascript OAuth API to examine the OAuth response for a particular service for which authentication was requested. For instance, if you were having issues connecting to Dropbox, you could inspect the OAuth response by going into the JavaScript console and entering:

Copy
skuid.oauth('dropbox').getAuthResponse();

This returns an object which should contain details of any errors that occurred with your OAuth flow for that service.

  • For all standard OAuth provider types, this will be accessible via skuid.oauth(provider_type) , which is usually the lowercase name of the provider type.
  • For other provider types, you will need to use the provider's name as defined on the connection record.

Removing stored OAuth access credentials

To remove stored OAuth access credentials for a particular service, call the following method:

Copy
skuid.oauth(provider_type_or_name).logout();

Authentication Merge Variables

{{Auth.API_Key}} : A reference to the API key stored when API Key Authentication is selected for a connection. When used, Nintex Apps injects the stored value on the server-side, so users cannot see the value. For more information, see the API Key Authentication section.

{{$Auth.BasicAuth}}

{{$Auth.Username}}

{{$Auth.Password}}

{{$Auth.Response.Body}} : Contains the values returned by the authentication request's response. It's possible to target specific body parameters by appending the parameter to the end of the merge variable. For example: {{$Auth.Response.Body.access_token}} would return the access_token parameter value included in the authentication request's response.

{{$Auth.Response.Headers}} : Contains the values returned by the authentication request's response. It's possible to target specific header parameters by appending the parameter to the end of the merge variable. For example: {{$Auth.Response.Headers.Expires}} would return the Expires header value included in the authentication request's response.

{{$Api.Session_Id}}

Encryption in Nintex Apps

The following fields are stored encrypted in Nintex Apps:

  • Connection (for org-wide credentials)
    • Username
    • Password
    • API key
    • Per-profile or per-user username
    • Per-profile or per-user password
  • Authentication Provider
    • Client Id
    • Client Secret