iOS/iPadOS - Native Apps

🚧

Custom URL Schemes

If you use custom URL schemes to launch your application in an iOS device, this is no longer a recommended workflow. Instead, you should be using Universal Links.

Please read the following article to learn more about custom URL schemes: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app

If you have a native app, you should use Universal Links to log users in to your application through Clever SSO. We've outlined the steps below!

Supporting Universal Links

Universal Links allow you to have your native app open when a user attempts to navigate to one of your URLs on a mobile device. If your app isn’t installed, users will be directed to your URL in the browser as normal.

Specifically this process involves registering a domain within your mobile app entitlements and upload a json verification file to that domain to confirm your app’s registration.

For instructions on how to implement this in your native mobile application, please see the documentation below:

🚧

Clever iOS SDK

The SDK has now been deprecated and is not needed to implement "Log in With Clever" on your iOS native application. Please see https://dev.clever.com/docs/liwc-ios-update to learn more.

SSO with Universal Links from the Clever Portal

  1. End-user starts from the Clever Portal and selects an application icon.
  2. As in non-mobile logins, Clever will redirect the user to your primary redirect URL and include the usual parameters.
  3. Since your native app is the primary handler of your URL, it will receive the authorization code.
  4. Your native app should send the code to your server via an endpoint that you build (or may already have built). In practice this endpoint would behave similarly to an endpoint to verify/redeem a user’s username/password during a traditional login flow.
  5. Upon receiving the authorization code, your server should exchange the code for a token and determine which account to log in to.
  6. Your server should then send data to your native app to initiate a session in the app with the user logged in.

SSO with Universal Links using a "Log in with Clever" Button

🚧

New Update with the "Log in With Clever" Flow on iOS.

We are deprecating the original iOS SDK in response to Apple's new guidelines for authentication. Please see https://dev.clever.com/docs/liwc-ios-update to learn more about this new flow.

  1. End-user starts from the login page of an application and selects the "Log in with Clever" option.
  2. As long as your redirect URL is registered as a Universal Link, an in-app web view will be launched within your native application and will navigate to a Clever authentication page.
  3. Upon authentication, your native app should send the authorization code to your server via an endpoint that you build (or may already have built). In practice this endpoint would behave similarly to an endpoint to verify/redeem a user’s username/password during a traditional login flow.
  4. Upon receiving the authorization code, your server should exchange the code for a token and determine which account to log in to.
  5. Your server should then send data to your native app to initiate a session in the app with the user logged in. The user will be redirected away from the native application webview and into the redirect URL that you have registered as a Universal Link.