Skip to content
No description, website, or topics provided.
Objective-C Java JavaScript Python Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Getting started

$ npm install react-native-nxlauth --save

Mostly automatic installation

$ react-native link react-native-nxlauth

Then follow the Setup steps to configure the native iOS and Android projects.

Manual installation


  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-react-native-nxlauth and add RNReactNativeNxlauth.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNReactNativeNxlauth.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<


  1. Open up android/app/src/main/java/[...]/
  • Add import; to the imports at the top of the file
  • Add new RNReactNativeNxlauthPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-nxlauth'
    project(':react-native-nxlauth').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-nxlauth/android')
  2. Insert the following lines inside the android, defaultConfig block in android/app/build.gradle:
      defaultConfig {
        manifestPlaceholders = [
          'appAuthRedirectScheme': ''
  3. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-nxlauth')
  4. Insert the following lines inside main app's android/app/src/main/res/values/strings.xml resource file:
      <string name="nxlauth_client_id">YOUR_CLIENT_ID</string>


iOS Setup

To setup the iOS project, you need to perform three steps:

  1. Install native dependencies
  2. Register redirect URL scheme
  3. Define openURL callback in AppDelegate
Install native dependencies

This library depends on the NXLAuth Framework project. To keep the React Native library agnostic of your dependency management method, the native libraries are not distributed as part of the bridge.

  1. CocoaPods

    With CocoaPods, add the following line to your Podfile:

    pod 'AppAuth', :git => ''

    Then run

    pod install.

  2. Download NXLAuth Framework

    Download the NXLAuth Framework file 👉 HERE 👈

    • Unzip and move the NXLAuth.framework into your project.
    • Add NXLAuth.framework into Embedded Binaries.
  3. Create a NXLAuthConfig.plist in your project.

    Right click from your project --> New File --> Resource --> choose Property List --> named it as "NXLAuthConfig.plist"

    add the following line to your NXLAuthConfig.plist.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
    <plist version="1.0">
                <string>YOUR ISSUER</string>
                <string>YOUR CLIENT ID</string>
                <string>YOUR REDIRECT URL</string>
Information You'll Need From Your idP
  • Issuer
  • Client ID
  • Redirect URI

Register redirect URL scheme

If you intend to support iOS 10 and older, you need to define the supported redirect URL schemes in your Info.plist as follows:

  • CFBundleURLName is any globally unique string. A common practice is to use your app identifier.
  • CFBundleURLSchemes is an array of URL schemes your app needs to handle. The scheme is the beginning of your OAuth Redirect URL, up to the scheme separator (:) character.
Define openURL callback in AppDelegate

You need to retain the auth session, in order to continue the authorization flow from the redirect. Follow these steps:

RNNxlauth will call on the given app's delegate via [UIApplication sharedApplication].delegate. Furthermore, RNNxlauth expects the delegate instance to conform to the protocol RNNxlauthAuthorizationFlowManager. Make AppDelegate conform to RNNxlauthAuthorizationFlowManager with the following changes to AppDelegate.h:

+ #import "RNNxlauthAuthorizationFlowManager.h"

- @interface AppDelegate : UIResponder <UIApplicationDelegate>
+ @interface AppDelegate : UIResponder <UIApplicationDelegate, RNNxlauthAuthorizationFlowManager>

+ @property(nonatomic, weak)id<RNNxlauthAuthorizationFlowManagerDelegate>authorizationFlowManagerDelegate;

The authorization response URL is returned to the app via the iOS openURL app delegate method, so you need to pipe this through to the current authorization session (created in the previous instruction). Thus, implement the following method from UIApplicationDelegate in AppDelegate.m:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options {
 return [self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url];


The universal framework will run on both simulators and Devices. But still there is a problem.

Need to remove unused architectures before submit to Apple app store. Because Apple doesn’t allow the application with unused architectures to the App Store. Please make sure that you have Remove Unused Architectures Script added in your project while releasing your app to app store.

Remove Unused Architectures

Select the Project, Choose Target → Project Name → Select Build Phases → Press “+” → New Run Script Phase → Name the Script as “Remove Unused Architectures Script”.

if [ "${CONFIGURATION}" = "Release" ]; then
for ARCH in $ARCHS
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"

This run script removes the unused Simulator architectures only while pushing the Application to the App Store.

Example App



import RNReactNativeNxlauth from 'react-native-react-native-nxlauth';

// TODO: What to do with the module?
You can’t perform that action at this time.