iOS Swift Getting Started

This multistep quickstart guide will walk you through managing authentication in your iOS Swift apps with Auth0.

About the Sample Applications

Each step within this quickstart guide (starting with Login) contains a downloadable sample which demonstrates the topic being covered. Within each of these samples, you will find an appropriate application to demonstrate the features discussed in the chapter.

Auth0 Dependencies

Each tutorial will require you to use the Auth0.swift toolkit.

A brief description:

  • Auth0.swift is a toolkit that lets you communicate efficiently with many of the Auth0 API functions and enables you to integrate the Login.

Create a Client

If you haven't already done so, create a new client application in your Auth0 dashboard and choose Native.

App Dashboard

Adding Auth0 Credentials

The dependencies listed above require your client credentials in order for them to work. If you downloaded any sample project from here, these credentials are automatically set. Either way, you have to make sure they are there otherwise your app might crash.

Add your credentials in Auth0.plist. You have to create that file if it doesn't already exist in your project:

<!-- Auth0.plist -->

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Configure Callback URLs

Callback URLs are the URLs that Auth0 invokes after the authentication process. Auth0 routes your application back to this URL and appends additional parameters to it, including a token. Since callback URLs can be manipulated, you will need to add your application's URL to your client's Allowed Callback URLs for security. This will enable Auth0 to recognize these URLs as valid. If omitted, authentication will not be successful.

In your application's Info.plist file, register your iOS Bundle Identifer as a custom scheme:

<!-- Info.plist -->


If your Info.plist is not shown in this format, you can Right Click on Info.plist in Xcode and then select Open As / Source Code.

Finally, go to your Client's Dashboard and make sure that "Allowed Callback URLs" contains the following:


Next Tutorial
2. Login
Use Auth0 for FREECreate free Account