Skip to content

auth0-blog/auth0-swift-protected-api-call

Repository files navigation

Companion project for the Auth0 Blog Calling a protected API from an iOS Swift App

Project Description

This repository contains completed version of the project featured in the Auth0 Blog Calling a protected API from an iOS Swift App. The article walks you through the process of calling a protected API once integrated with Auth0 authentication in an iOS app based on the SwiftUI framework.

Getting Started

Prerequisites

  • As an iOS project, it needs to be built on a computer running macOS, preferably macOS 11.6, a.k.a. “Big Sur” or later.
  • The project is built using Apple’s official IDE, Xcode (preferably version 12 or later), which is available for download via the macOS App Store or from the Apple Developer site.
  • You’ll need an iOS device, either real or virtual:
    • If you want to deploy the app to a real iOS device, you’ll need a free Apple Developer account, which requires an Apple ID with two-factor authentication enabled.
    • If you want to deploy the app to a virtual iOS device, you just need Xcode, which includes the Simulator (which simulates current iOS devices and operating systems), as well as a facility for downloading simulators for older iOS devices and operating systems.

Installing and running the app

  1. If you don’t already have an Auth0 account, sign up for a free one.

  2. Clone the repo: git clone https://github.com/auth0-blog/auth0-swift-protected-api-call.git

  3. Install the Auth0.swift package using Xcode:

    • In Xcode, select FileAdd Packages.... The Add Packages window will appear.
    • In Add Packages window, enter this URL into the search field: https://github.com/auth0/Auth0.swift.git.
    • Select the Auth0.swift package that appears in the list of packages and in the Dependency Rule menu, select Up to Next Major Version.
    • Click Add Package.
  4. Log into the Auth0 dashboard and then follow the steps in the Auth0 Blog article for more details.

Additional Reading

License

The code in this repository is licensed under the Apache 2.0 License.

About

Calling a Protected API from an iOS Swift App integrated with Auth0

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages