NXLAuth for iOS

Native SDK

View the Framework on GitHub digitalme-my/NXLAuth-iOS

View the NXLAuth Example on GitHub digitalme-my/NXLAuth-iOS-example

Browse the API documentation

React Native library

View the React Native library on GitHub digitalme-my/react-native-nxlauth

NXLAuth for iOS

Build Status Build Status

NXLAuth for iOS a client SDK for communicating with OAuth 2.0 and OpenID Connect providers. It strives to directly map the requests and responses of those specifications, while following the idiomatic style of the implementation language. In addition to mapping the raw protocol flows, convenience methods are available to assist with common tasks like performing an action with fresh tokens.

It follows the best practices set out in OAuth 2.0 for Native Apps including using SFSafariViewController on iOS for the auth request. For this reason, UIWebView is explicitly not supported due to usability and security reasons.

It also supports the PKCE extension to OAuth which was created to secure authorization codes in public clients when custom URI scheme redirects are used. The library is friendly to other extensions (standard or otherwise) with the ability to handle additional params in all protocol requests and responses.

Specification

iOS

Supported Versions

NXLAuth supports iOS 7 and above.

iOS 9+ uses the in-app browser tab pattern (via SFSafariViewController), and falls back to the system browser (mobile Safari) on earlier versions.

Authorization Server Requirements

Both Custom URI Schemes (all supported versions of iOS) and Universal Links (iOS 9+) can be used with the library.

In general, NXLAuth can work with any Authorization Server (AS) that supports native apps, either through custom URI scheme redirects, or universal links. AS's that assume all clients are web-based or require clients to maintain confidentiality of the client secrets may not work well.

Setup

If you use CocoaPods, simply add:

pod 'AppAuth', :git => 'https://github.com/digitalme-my/AppAuth-iOS.git'

To your Podfile and run pod install. Otherwise, add AppAuth.xcodeproj into your workspace.

API Documentation

Browse the API documentation.

Included Samples

You can try out the iOS sample included in the source distribution by opening Example/Example.xcworkspace. You can easily convert the Example workspace to a Pod workspace by deleting the AppAuth project, and configuring the pod. You can also try out the sample via CocoaPods. Be sure to follow the instructions in Example/README.md to configure your own OAuth client ID for use with the example.

You can try out the macOS sample included in the source distribution by executing pod install in the Example-Mac folder, then opening Example-Mac.xcworkspace. Be sure to follow the instructions in Example-Mac/README.md to configure your own OAuth client ID for use with the example.