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
SFSafariViewController on iOS for the auth request. For this
UIWebView is explicitly not supported due to usability and security
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.
NXLAuth supports iOS 7 and above.
iOS 9+ uses the in-app browser tab pattern
SFSafariViewController), and falls back to the system browser (mobile
Safari) on earlier versions.
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.
If you use CocoaPods, simply add:
pod 'AppAuth', :git => 'https://github.com/digitalme-my/AppAuth-iOS.git'
Podfile and run
pod install. Otherwise, add
into your workspace.
Browse the API documentation.
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
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.