iOS Swift: Getting Started

Gravatar for
By Martin Walsh

This quickstart guide walks you through managing authentication with Auth0 in your iOS Swift apps.

Sample Projects

Each tutorial in this guide includes a link to a sample project showing the features described in the article. You can find all the samples in the iOS Swift samples folder.


Each tutorial uses the Auth0.swift toolkit. It is a toolkit that lets you efficiently communicate with many of the basic Auth0 API functions.

Create an application

Create a new application in your Auth0 dashboard. For Type, select Native.

Add Auth0 Credentials

You will need some details about this application to communicate with Auth0. You can get these details from the Application Settings in the Auth0 dashboard.

You need the following information:

  • Client ID
  • Domain

If you download the sample from the top of this page, these details are filled out for you. If you have more than one application in your account, the sample comes with the values for your Default App.

Add your credentials in the Auth0.plist file. If the file does not exist in your project yet, create it:

<!-- 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

A callback URL is a URL in your application where Auth0 redirects the user after they have authenticated.

You need to whitelist the callback URL for your app in the Allowed Callback URLs field in your Application Settings. If you do not set any callback URL, your users will see a mismatch error when they log in.

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

<!-- Info.plist -->


If your Info.plist file is not in the format shown above, you can right-click Info.plist in Xcode and select Open As > Source Code.

Go to your Dashboard Settings and make sure that the Allowed Callback URLs field contains the following callback URL:

Use Auth0 for FREECreate free Account