The Kinde iOS Starter Kits are simple apps that demonstrate how to integrate your app with the Kinde authentication service and management API.
To get started set up an account on Kinde.
Clone this repo.
This workspace contains two iOS starter kits:
- KindeAuth - a simple app demonstrating use of the Kinde Auth service for login, authenticated API call to the Kinde Management API, and logout. KindeAuth is implemented with SwiftUI, using programmatic view layout.
- KindeAuthUIKit - a simple app also demonstrating use of the Kinde Auth service, implemented in UIKit designed using a Storyboard.
To setup either example project, run pod install
in the app directory first.
Then find this configuration block in the kinde-auth.json
file:
{
"issuer": "https://<your_kinde_subdomain>.kinde.com",
"clientId": "<your_kinde_client_id>",
"redirectUri": "<your_url_scheme>://kinde_callback",
"postLogoutRedirectUri": "<your_url_scheme>://kinde_logoutcallback",
"scope": "offline openid email profile"
}
In the configuration block above replace the following placeholders with values from your Kinde App Keys page:
https://<your_kinde_subdomain>.kinde.com
with theToken host
value<your_kinde_client_id
with theClient ID
value.
Your user will be redirected to Kinde to authenticate. After they have logged in or registered they will be redirected back to your iOS app.
You need to specify in Kinde which url you would like your user to be redirected to in order to authenticate your app.
On the App Keys page set Allowed callback URLs
to <your_url_scheme>://kinde_callback
, where your_url_scheme
can be any valid custom url scheme,
such as your app's bundle ID or an abbreviation.
Important! This is required for your users to successfully log in to your app.
You will also need to set the url they will be redirected to upon logout. Set the Allowed logout redirect URLs
to <your_url_scheme>://kinde_logoutcallback
.
Start your app in XCode, click on Sign up
and register your first user for your business!
If you navigate to the "Users" page within Kinde you will see your newly registered user there. 🚀