Example Project
March 20, 2017 ยท View on GitHub
Setup & Open the Project
- In the
Example-macOSfolder, run the following command to install the AppAuth pod.
pod install
- Open the
Example-macOS.xcworkspaceworkspace
open Example-macOS.xcworkspace
This workspace is configured to include AppAuth via CocoaPods. You can also
directly include AppAuth as a static library using the build targets in the
AppAuth.xcodeproj project.
Configuration
The example doesn't work out of the box, you need to configure it with your own client ID.
Information You'll Need
- Issuer
- Client ID
- Client Secret
- Redirect URI (optional: if not using loopback).
How to get this information varies by IdP, but we have instructions for some OpenID Certified providers.
Configure the Example
In the file AppAuthExampleViewController.m
- Update
kIssuerwith the IdP's issuer. - Update
kClientIDwith your new client id. - Update
kClientSecretwith your client id's secret. - Update
kRedirectURIredirect URI (optional: if not using loopback)
In the file Info.plist
Fully expand "URL types" (a.k.a. CFBundleURLTypes) and replace
com.example.app with the scheme of your redirect URI.
The scheme is everything before the colon (:). For example, if the redirect
URI is com.example.app:/oauth2redirect/example-provider, then the scheme
would be com.example.app.
Running the Example
Now your example should be ready to run.