Git Product home page Git Product logo

react-native-lock's Introduction

This library is DEPRECATED

We recommend following our react-native quickstart and using https://github.com/auth0/react-native-auth0.

react-native-lock

NPM version CI Status

Auth0 is an authentication broker that supports social identity providers as well as enterprise identity providers such as Active Directory, LDAP, Google Apps and Salesforce.

react-native-lock is a wrapper around Lock's implementations for iOS and Android ready to use for React Native

Before you start

Starting 8th June 2017 Auth0 restricted some Auth flows for new Auth0 clients (Grant types), even if your account was created before that date, so this library won't work out of the box since it relies on legacy grants. If you were already using this libary before 8th June, you can go to your client's settings and enable the grants you neeed.

  • Legacy: RO (http://auth0.com/oauth/legacy/grant-type/ro): for database connections
  • Legacy: RO jwt bearer (http://auth0.com/oauth/legacy/grant-type/ro/jwt-bearer): for TouchID
  • Legcy: Access Token (http://auth0.com/oauth/legacy/grant-type/access_token): for native social integrations

In our documentation you will find more information about Grant types.

We will continue fixing bugs for react-native-lock for the time being.

Requirements

iOS

Android

  • Minimum SDK 16

Installation

Run npm install --save react-native-lock to add the package to your app's dependencies.

iOS

react-native cli

Run react-native link react-native-lock so your project is linked against your Xcode project & install Lock for iOS using CocoaPods and run react-native run-ios

Manually

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-lock and add A0RNLock.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libA0RNLock.a to your project's Build PhasesLink Binary With Libraries
  4. Click A0RNLock.xcodeproj in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Header Search Paths and make sure it contains $(SRCROOT)/../react-native/React, $(SRCROOT)/../../React, ${SRCROOT}/../../ios/Pods/Headers/Public and ${SRCROOT}/../../ios/Pods/Headers/Public/Lock - all marked as recursive.
  5. Inside your ios directory add a file named Podfile with the following content
  6. Run pod install --project-directory=ios
  7. Run react-native run-ios

CocoaPods Warning

If you get the following warning.

[!] The `<YourAppName> [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `<YourAppName> [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

Click <YourAppName>.xcodeproj in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Other Linker Flags and replace the value -ObjC with the value $(inherited) for your Application's Target.

Compile error react-native >=0.26.0

If you are using a react-native version >=0.26.0, you might encounter the following error while trying to run the project

"std::terminate()", referenced from:
        ___clang_call_terminate in libReact.a(RCTJSCExecutor.o)

React Native introduced some C++ code so we need to tell Xcode to include use those symbols for compile. First click <YourAppName>.xcodeproj in the Project Navigator to show your project's target (at least one for your app). Then for each of the targets do the following:

  • Go the Build Settings tab, and make sure All is toggled on (instead of Basic)
  • Look for Other Linker Flags and add the flag -lc++ for all configurations

If your project was created using react-native init command, you will have two targets (app & tests) so make sure BOTH of them has the correct flags

CocoaPods with uses_framework! flag

This more of a hack than an actual solution. We recommend to avoid including Lock as a dynamic framework unless you have a very good reason to do that.

After setting up react-native-lock either Manually or using react-native cli you need to open your iOS project with Xcode and follow these steps:

  1. Click A0RNLock.xcodeproj in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Framework Search Paths and make sure it contains $BUILD_DIR/$CONFIGURATION$EFFECTIVE_PLATFORM_NAME/Lock
  2. Change to the A0RNLock.xcodeproj target tab Build Phases, and in the section Link Binary with Libraries click the + and add Lock.framework and make sure it's Status is set to optional
  3. In the project navigator, select your project (should be the top one) and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic') and look for Other Linker Flags and make sure the value -ObjC is listed there

Android

react-native cli

Run react-native link react-native-lock so your project is linked against your Android project

In your file android/app/build.gradle, inside the android section add the following

packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}

Then in your android/app/src/main/AndroidManifest.xml add the following inside <application> tag

<!--Auth0 Lock-->
<activity
  android:name="com.auth0.lock.LockActivity"
  android:theme="@style/Lock.Theme"
  android:screenOrientation="portrait"
  android:launchMode="singleTask">
</activity>
<!--Auth0 Lock End-->
<!--Auth0 Lock Embedded WebView-->
<activity
    android:name="com.auth0.identity.web.WebViewActivity"
    android:theme="@style/Lock.Theme">
</activity>
<!--Auth0 Lock Embedded WebView End-->
<!--Auth0 Lock Passwordless-->
<activity
    android:name="com.auth0.lock.passwordless.LockPasswordlessActivity"
    android:theme="@style/Lock.Theme"
    android:screenOrientation="portrait"
    android:launchMode="singleTask">
</activity>
<activity
    android:name="com.auth0.lock.passwordless.CountryCodeActivity"
    android:theme="@style/Lock.Theme">
</activity>
<!--Auth0 Lock Passwordless End-->

And finally run react-native run-android

Manually

In your file android/settings.gradle add the following

include ':react-native-lock'
project(':react-native-lock').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-lock/android')

In the file android/app/build.gradle add a new dependency

dependencies {
  //Other gradle dependencies...
  compile project(':react-native-lock')
}

And in the same file inside the android section

packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}

This fixes the error `Error: duplicate files during packaging of APK

Then in the file MainApplication.java add the following Java import

import com.auth0.lock.react.LockReactPackage;

In react-native versions older than 0.29 you should add do this in MainActivity.java instead

and add Lock's React Native module

    /**
     * A list of packages used by the app. If the app uses additional views
     * or modules besides the default ones, add more packages here.
     */
    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            //Other RN modules
            new LockReactPackage()
        );
    }

Then in your android/app/src/main/AndroidManifest.xml add the following inside <application> tag

<!--Auth0 Lock-->
<activity
  android:name="com.auth0.lock.LockActivity"
  android:theme="@style/Lock.Theme"
  android:screenOrientation="portrait"
  android:launchMode="singleTask">
</activity>
<!--Auth0 Lock End-->
<!--Auth0 Lock Embedded WebView-->
<activity
    android:name="com.auth0.identity.web.WebViewActivity"
    android:theme="@style/Lock.Theme">
</activity>
<!--Auth0 Lock Embedded WebView End-->
<!--Auth0 Lock Passwordless-->
<activity
    android:name="com.auth0.lock.passwordless.LockPasswordlessActivity"
    android:theme="@style/Lock.Theme"
    android:screenOrientation="portrait"
    android:launchMode="singleTask">
</activity>
<activity
    android:name="com.auth0.lock.passwordless.CountryCodeActivity"
    android:theme="@style/Lock.Theme">
</activity>
<!--Auth0 Lock Passwordless End-->

For more information and configuration options you should see the Lock.Android docs

And finally run react-native run-android

Usage

Let's require react-native-lock module:

var Auth0Lock = require('react-native-lock');

And initialize it with your Auth0 credentials that you can get from our dashboard

var lock = new Auth0Lock({clientId: "YOUR_CLIENT_ID", domain: "YOUR_DOMAIN"});

Email/Password, Enterprise & Social authentication

lock.show({}, (err, profile, token) => {
  console.log('Logged in!');
});

And you'll see our native login screen

Lock.png

Avoid WebView for Social Auth

In order to make Lock use the OS browser to perform Web Auth you will need to pass the attribute useBrowser when you build Lock like

var lock = new Auth0Lock({clientId: "YOUR_CLIENT_ID", domain: "YOUR_DOMAIN", useBrowser: true});

Then you need to configure both your iOS and Android project following the instructions detailed below.

IMPORTANT: This feature only works with iOS 9 or later.

iOS

In the file AppDelegate.m add the following import on the top (next to the other imports of the file)

#import "A0LockReact.h"

and then inside the AppDelegate implementation add the following method

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  return [[A0LockReact sharedInstance] handleURL:url sourceApplication:nil];
}

And finally in the file Info.plist add the following entry

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLName</key>
    <string>auth0</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>{Bundle Identifier}</string>
    </array>
  </dict>
</array>

Where the Bundle identifier can be found in the same file under the key CFBundleIdentifier like

<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>

Android

In the file AndroidManifest find where the LockActivity is declared and insde the activity tags add the following

<intent-filter>
  <action android:name="android.intent.action.VIEW"/>
  <category android:name="android.intent.category.DEFAULT"/>
  <category android:name="android.intent.category.BROWSABLE"/>
  <data android:scheme="a0{your lowercase auth0 client id}" android:host="{your auth0 domain}"/>
</intent-filter>

And make sure Lock's activity launch mode is singleTask

TouchID (iOS Only)

lock.show({
  connections: ["touchid"]
}, (err, profile, token) => {
  console.log('Logged in!');
});

And you'll see TouchID login screen

Lock.png

Because it uses a Database connection, the user can change it's password and authenticate using email/password whenever needed. For example when you change your device.

SMS Passwordless

lock.show({
  connections: ["sms"]
}, (err, profile, token) => {
  console.log('Logged in!');
});

And you'll see SMS Passwordless login screen

Lock.png

Email Passwordless

lock.show({
  connections: ["email"]
}, (err, profile, token) => {
  console.log('Logged in!');
});

And you'll see Email Passwordless login screen

Lock.png

Upgrading

If you are upgrading your react-native version just run react-native upgrade and overwrite all conflicts (option a or overwrite this and all others).

If you have custom code in any of the conflict files, like AppDelegate.m, it's probably best to backup a copy to apply those changes later.

Then run react-native link react-native-lock and follow the same steps like you did the first time you installed the library.

API

Lock

####.show(options, callback) Show Lock's authentication screen as a modal screen using the connections configured for your applications or the ones specified in the options parameter. This is the list of valid options:

  • closable (boolean): If Lock screen can be dismissed
  • disableSignUp (boolean): default to false, if true will hide the signup button
  • disableResetPassword (boolean): default to false, if true will hide the reset password button
  • connections ([string]): List of enabled connections to use for authentication. Must be enabled in your app's dashboard first.
  • authParams (object): Object with the parameters to be sent to the Authentication API, e.g. scope.

The callback will have the error if anything went wrong or after a successful authentication, it will yield the user's profile info and tokens.

####.authenticationAPI() Returns Auth0 Authentication API client that can be used to refresh user's token, obtain user information or call Auth0 delegation.

For more info check react-native-auth0

####.usersAPI(token) Returns Auth0 Users API client using a valid user's token for Management API. With this client you can update user's metadata or link two user accounts.

For more info check react-native-auth0

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

What is Auth0?

Auth0 helps you to:

  • Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
  • Add authentication through more traditional username/password databases.
  • Add support for linking different user accounts with the same user.
  • Support for generating signed Json Web Tokens to call your APIs and flow the user identity securely.
  • Analytics of how, when and where users are logging in.
  • Pull data from other sources and add it to the user profile, through JavaScript rules.

Create a free account in Auth0

  1. Go to Auth0 and click Sign Up.
  2. Use Google, GitHub or Microsoft Account to login.

Author

Auth0

License

react-native-lock-ios is available under the MIT license. See the LICENSE file for more info.

react-native-lock's People

Contributors

aaguiarz avatar annyv2 avatar arjunkomath avatar brianneisler avatar chirag04 avatar frederickfogerty avatar grifotv avatar hzalaz avatar jmoutte avatar keeth avatar narek11 avatar robmoorman avatar twistedstream avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-lock's Issues

Inconsistent Android and iOS profile upon login

When logging into a social provider on iOS, the data response from the result contains the identities object. However, when logging into Android, the data response does not contain the response object.

authParams: {
            scope: 'openid name offline_access',
            device: 'Mobile device'
          }

React Native v0.27
Lock v0.3.0

facebook login doesn't work when facebook app is installed

I am able to successfully launch and login through the facebook login page in the iOS simulator. However, when test my app on my actual iPhone 6s, when I click the 'Login with Facebook' button from the Auth0 lock screen, the app hangs with a loading circle. The app is not frozen--I can cancel Lock--but the request to load the facebook login page never resolves. As mentioned, the flow works fine on the simulator, but not when I test on my device. Is there any additional configuration I would need to do to get this working on my device? I am using react-native ^0.26.2 and react-native-lock ^0.2.0.

Thanks!

UPDATE:
Ok I found the at least the beginning of the issue. Line 344 of FBSDKLoginManager.m, if ([FBSDKInternalUtility isFacebookAppInstalled]). In the simulator this returns false and everything works fine. On my device this returns true, and the resulting code execution hangs. I stubbed this line to always return false, and it works for now. Thanks for your time looking into this issue!

Closable not working on Android

Good Morning Auth0,

I am using the closable option on IOS without any issues however on Android the "X" in the top left hand corner does not appear, so the user has to login to get exit the Auth0 screen.

lock.show({
  closable:true,
  }, (err, profile, token) => {

how to use both ios and android libs in the same entry file

I have an application where the entry file is index.js (i.e. i'm not using index.android.js nor index.ios.js).

I'm a bit surprised about the choice to split your library into two projects react-native-lock-ios and react-native-lock-android, this decision seems to be more developer friendly than user friendly.

That being said, how can I import both libraries in my index.js file? I tried many things like:

if (Platform === 'ios') {
  import Auth0Lock from 'react-native-lock-ios';
} else {
  import Auth0Lock from 'react-native-lock-android';
}

(which of course doesn't work because es6 does not allows dynamic import/export.)

Update user.app_metadata

I searched through the auth0 documentation for this and couldn't find it. What's the preferred way to update the user object from a RN application, in particular I'm interested in updating user.app_metadata the closest I found was how to accomplish this using auth0 rules, but I didn't see anything similar for the RN API.

Thanks for the great library,

A0LockReact.m delegationWithOptions passes null dictionary when attempting to obtain firebase token, crashing app

Hi there,

If I attempt to obtain a firebase token through the Auth0 delegation API as such, my application crashes in native code.

    lock.delegation({
        token: token,
        api: "firebase"
      }, (a,b,c) => {
        console.log("delegation callback",a,b,c);
      });

The crash I see in the XCode console is as follows:


2016-05-10 16:20:18.465 TodoApp[25813:911468] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000112077d85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000011126cdeb objc_exception_throw + 48
    2   CoreFoundation                      0x0000000111f7423e -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 318
    3   CoreFoundation                      0x0000000111f865bb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
    4   TodoApp                             0x000000010e57e584 -[A0LockReact delegationWithOptions:callback:] + 1556
    5   TodoApp                             0x000000010e580fe4 __41-[A0LockReactModule delegation:callback:]_block_invoke + 84
    6   libdispatch.dylib                   0x0000000113a0fd9d _dispatch_call_block_and_release + 12
    7   libdispatch.dylib                   0x0000000113a303eb _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x0000000113a181ef _dispatch_main_queue_callback_4CF + 1738
    9   CoreFoundation                      0x0000000111fd10f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    10  CoreFoundation                      0x0000000111f92b99 __CFRunLoopRun + 2073
    11  CoreFoundation                      0x0000000111f920f8 CFRunLoopRunSpecific + 488
    12  GraphicsServices                    0x000000011512cad2 GSEventRunModal + 161
    13  UIKit                               0x000000010f6f2f09 UIApplicationMain + 171
    14  TodoApp                             0x000000010e331daf main + 111
    15  libdyld.dylib                       0x0000000113a6492d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

After stepping through the code, it appears that this is because the scopeParamterFromOptions method returns a nil if no scope is provided.

Providing an empty string for the scope parameter prevents the crash:

      lock.delegation({
        token: token,
        api: "firebase",
        scope: ""
      }, (a,b,c) => {
        console.log("delegation callback",a,b,c);
      });

But this still doesn't work - Auth0 calls my callback with the error Request failed: bad request (400). I can't see any documentation for what should go in the scope parameter for a request for a firebase token.

No Exit on Login Screen

I notice there is a cancel button in the top right hand corner of the images in the README but when I followed instructions it does not appear. Can you tell me how to add it?
screen shot 2016-03-24 at 5 33 52 pm

Seed Project Will Not Compile In XCode

I downloaded the seed project from the documentation site (React Native iOS Quickstart) and ran it without any modifications using the same conditions the quickstart said it has been tested in:

  • React Native 0.26.0
  • Node 4.3
  • CocoaPods 1.0.0

It compiled and ran fine in the simulator using react-native run-ios.

When I tried to compile it in XCode, it failed with the following issue:

ld: warning: directory not found for option '-L/Users/brennan/Library/Developer/Xcode/DerivedData/Auth0Sample-eladxhulkghakbblmlqoogfnnarc/Build/Products/Debug-iphonesimulator/AFNetworking'
ld: warning: directory not found for option '-L/Users/brennan/Library/Developer/Xcode/DerivedData/Auth0Sample-eladxhulkghakbblmlqoogfnnarc/Build/Products/Debug-iphonesimulator/CocoaLumberjack'
ld: warning: directory not found for option '-L/Users/brennan/Library/Developer/Xcode/DerivedData/Auth0Sample-eladxhulkghakbblmlqoogfnnarc/Build/Products/Debug-iphonesimulator/Lock'
ld: warning: directory not found for option '-L/Users/brennan/Library/Developer/Xcode/DerivedData/Auth0Sample-eladxhulkghakbblmlqoogfnnarc/Build/Products/Debug-iphonesimulator/Masonry'
ld: warning: directory not found for option '-L/Users/brennan/Library/Developer/Xcode/DerivedData/Auth0Sample-eladxhulkghakbblmlqoogfnnarc/Build/Products/Debug-iphonesimulator/SimpleKeychain'
ld: warning: directory not found for option '-L/Users/brennan/Library/Developer/Xcode/DerivedData/Auth0Sample-eladxhulkghakbblmlqoogfnnarc/Build/Products/Debug-iphonesimulator/TouchIDAuth'
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The problem could be solved by manually linking the Pods/Pods.xcodeproj.

It seems there may be a problem with rnpm link or pod install in that it doesn't like the Pod xcode project to the libraries. I don't have any experience with making rnpm work with a given project... is this an easy fix or does it just need to be documented.

Issues with running rnpm

rnpm link creates the following diff:

-               462209601C9712F1000120E6 /* Auth0 in Resources */ = {isa = PBXBuildFile; fileRef = 4622095F1C9712F1000120E6 /* Auth0 */; };
+               462209601C9712F1000120E6 /* (null) in Resources */ = {isa = PBXBuildFile; };

Build fails with vanilla project

Build fails with vanilla project using React Native 0.30. Steps to reproduce:

react-native init myproject
cd myproject
react-native run-ios

At this point everything is fine. The "Welcome to React Native" screen appears. Then Auth0 Lock is installed:

npm install --save react-native-lock
rnpm link react-native-lock

Pod installation complete! There are 4 dependencies from the Podfile and 6 total
pods installed.

react-native run-ios

Build errors:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld build/Build/Products/Debug-iphonesimulator/myproject.app/PlugIns/myprojectTests.xctest/myprojectTests normal x86_64
(1 failure)
/Users/nomad/Mobile/myproject/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: xcodebuild process exited with code 65
    at ChildProcess.xcodeBuildProcess.on.code (runIOS.js:102:14)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:850:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

-lc++ is already listed in Other Linker Flags so that is not the issue.

ld: 221 duplicate symbols for architecture x86_64

Once I have pod install and then open the .xcworkspace. Attempting to run:

duplicate symbol _OBJC_CLASS_$_RCTVirtualImageManager in:
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libReact.a(RCTVirtualImageManager.o)
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libRCTImage.a(RCTVirtualImageManager.o)
duplicate symbol _OBJC_METACLASS_$_RCTVirtualImageManager in:
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libReact.a(RCTVirtualImageManager.o)
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libRCTImage.a(RCTVirtualImageManager.o)
duplicate symbol _OBJC_CLASS_$_RCTImageStoreManager in:
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libReact.a(RCTImageStoreManager.o)
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libRCTImage.a(RCTImageStoreManager.o)
...
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketExecutor in:
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libReact.a(RCTWebSocketExecutor.o)
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a(RCTWebSocketExecutor.o)
duplicate symbol _OBJC_IVAR_$_RCTWebSocketExecutor._url in:
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libReact.a(RCTWebSocketExecutor.o)
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a(RCTWebSocketExecutor.o)
duplicate symbol _OBJC_IVAR_$_RCTWebSocketExecutor._jsQueue in:
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libReact.a(RCTWebSocketExecutor.o)
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a(RCTWebSocketExecutor.o)
duplicate symbol _OBJC_IVAR_$_RCTWebSocketExecutor._socketOpenSemaphore in:
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libReact.a(RCTWebSocketExecutor.o)
    /Users/alex/Library/Developer/Xcode/DerivedData/qsi-dbkmltjrefgyjbctqvuiubbxvspu/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a(RCTWebSocketExecutor.o)
ld: 221 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Logout Implementation

Hi All,
We have integrated this in mobile app development, But we didn't find implementation for logout. That is how to call logout on lock object. And we have gone through auth0-lock.js and other files, we didn't find any code for logout. Could you guys tell us how to logout a user from auth0 using react-native-lock.

Retrieve profile metadata when calling show

Is there a way to retrieve either the user or app metadata as part of the profile that is provided upon completion of a call to the show method? I can see how to retrieve it as part of the token, by configuring the authParams/scope option, but I can't figure out why the provided profile object omits it, and it would be great if I didn't need to make an additional API to retrieve the user profile, simply to retrieve the app/user metadata.

Fail to compile after installing with rnpm with [email protected]

Hi,

First of all thanks for building this wrapper for react native. It was working fine until I upgrade react native to 0.26.2. In an earlier time, react was running on 0.25.x and everything is fine. I did the following steps to upgrade to react native, and the project does not compile unless I remove react-native-lock and all Cocoapods related files.

Steps:

npm install --save [email protected]
npm install --save [email protected]
npm install --save [email protected]
react-native upgrade # This leads me to run
npm install --save-dev [email protected]
rnpm upgrade

After these steps, I cleared watchman cache and deleted folder ./ios/build.

The error I get when building:

The following commands produced analyzer issues:
    Analyze Modules/RCTUIManager.m
(1 command with analyzer issues)

The following build commands failed:
    Ld build/Build/Products/Debug-iphonesimulator/XXX.app/XXX normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/XXX.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/path to project folder/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/XXX.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:470:13)
    at Object.execFileSync (child_process.js:490:13)
    at _runIOS (runIOS.js:91:34)
    at runIOS.js:24:5
    at tryCallTwo (/path to project folder/node_modules/promise/lib/core.js:45:5)
    at doResolve (/path to project folder/node_modules/promise/lib/core.js:200:13)
    at new Promise (/path to project folder/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/path to project folder/node_modules/react-native/local-cli/cli.js:87:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)

Thanks for taking a look at the issue. Comment if any additional information is in need.

Issue with Dynamic Frameworks and cocoaPods

Also make sure you are not adding use_frameworks! in your Podfile, there is a known issue with Dynamic Frameworks that needs to be fixed.

Is it an issue with CocoaPods or Lock?
Because if I'm not wrong, you need to use use_frameworks! with Swift pods.
Then how can I do?

Here is what I get when I uncomment use_frameworks!

screenshot 2016-05-09 12 47 43

LinkedIn implementation

Hello,
when implementing oAuth (for LinkedIn) inside a React Native WebView Component, Once successfully logged in and the uri-redirect is initiated, how do I trigger and pass the token back into the non-WebView React Native Component or store it asyncStorage for future use. Either using Promises, async/await or any alternative method of delivery.
Thank you.

ExceptionsManager.js:61 Cannot read property 'init' of undefined

on button click i am calling a method which has below code

_onShowLock() {
lock.show({}, (err, profile, token) => {
console.log('Logged in!');
});
}

and lock.show method giving the "Cannot read property 'init' of undefined" error in Xcode Simulator.
anything i am missing?

Build failed: symbol(s) not found for architecture x86_64

Hi,

just added as described in the README the npm library "react-native-lock" and linked it with rnpm:
rnpm link react-native-lock

I also added the value "$(inherited)" to "Other Liner Flags" for all configurations:
bildschirmfoto 2016-06-01 um 11 09 53

I try to run the xcode project with "react native run-ios" and get the the following error:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_A0AuthParameters", referenced from:
      objc-class-ref in libA0RNLock.a(A0LockReact.o)
  "_OBJC_CLASS_$_A0Lock", referenced from:
      objc-class-ref in libA0RNLock.a(A0LockReact.o)
     (maybe you meant: _OBJC_CLASS_$_A0LockReact, _OBJC_CLASS_$_A0LockReactModule )
  "_OBJC_CLASS_$_A0Telemetry", referenced from:
      objc-class-ref in libA0RNLock.a(A0LockReact.o)
  "_OBJC_CLASS_$_A0Token", referenced from:
      l_OBJC_$_CATEGORY_A0Token_$_ReactNative in libA0RNLock.a(A0Token+ReactNative.o)
  "_OBJC_CLASS_$_A0UserIdentity", referenced from:
      l_OBJC_$_CATEGORY_A0UserIdentity_$_ReactNative in libA0RNLock.a(A0UserIdentity+ReactNative.o)
  "_OBJC_CLASS_$_A0UserProfile", referenced from:
      l_OBJC_$_CATEGORY_A0UserProfile_$_ReactNative in libA0RNLock.a(A0UserProfile+ReactNative.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

However the app starts in the simulator but the call of the login screen with "lock.show" doesn't work.

My npm package.json looks like:

{
  "name": "safari",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "apphub": "^0.5.1",
    "autoresponsive-react-native": "^1.0.8",
    "react": "0.14.8",
    "react-addons-update": "^15.0.2",
    "react-mixin": "^2.0.2",
    "react-native": "0.25.1",
    "react-native-button": "1.5.0",
    "react-native-drawer": "^2.2.2",
    "react-native-image-picker": "^0.18.15",
    "react-native-linear-gradient": "^1.5.7",
    "react-native-lock": "^0.2.0",
    "react-native-mapbox-gl": "4.1.1",
    "react-native-picker": "^2.0.5",
    "react-native-router-flux": "3.22.23",
    "react-native-vector-icons": "^2.0.2",
    "react-timer-mixin": "^0.13.3"
  }
}

The Podfile looks like:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target 'safari' do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for safari

  target 'safariTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

# Auth0 Lock

pod 'Lock', '~> 1.26'
pod 'Lock/TouchID'
pod 'Lock/SMS'
pod 'Lock/Email'

For me the error looks like that one of the dependencies of Lock is not build for x86_64. Is that right? So I do need to change my target architecture?

Thanks for your help!

Error Evaluating LockModule.init (iOS)

Another one of my many issues after upgrading RN to .29.1.

I had this error on iPhone 6 emulator, but fixed it by re-linking Lock. I'm getting the same error on iPhone 5 now and can't get it to work. Why the heck would it work on 6 but not 5??

screen shot 2016-07-17 at 8 00 52 pm

Code implementing login:

`
import React, {Component} from 'react';
import {
StyleSheet
, Text
, View
, Image
, TouchableOpacity
, AsyncStorage
, ActivityIndicator
} from 'react-native';
import {connect} from 'react-redux';
import { web_url } from '../../api/urls';
import * as cred from '../../auth0-credentials';
import * as r from '../scene_names/routes';
import Auth0Lock from 'react-native-lock';
import {loginBidder} from '../../reducers/user-info';
import {setError} from '../../reducers/error';
import {loginAuth} from '../../api/login';
import websocket from '../../api/websocket';
import Button from '../../components/shared/button/button';

    let lock = new Auth0Lock({
        clientId: cred.CLIENT_ID,
        domain: cred.DOMAIN
    });

    class AuthLogin extends Component {
        constructor(p) {
            super(p);

            this.state = {
                profile: null
                , loading: false
                , disabled: false //for the login button. Auth0 shows this screen after you login for a second,
                // so we need to make sure they can't click the login button again.
            }
        }

        _needsEmail(email, opt) {
            const incorrectEmail = email == "";
            return opt && incorrectEmail;
        }

        _needsPhone(phone, opt) {
            const incorrectPhone = phone.toString().length < 10;
            return opt && incorrectPhone;
        }


        _onLogin() {
            this.setState({ loading: true, disabled: true });

            const {mainNavigator, login, setError} = this.props;
            lock.show({
                closable: true
                , socialBigButtons: true
                // , connections: ["touchid"]
            }, (err, profile, token) => {
                if (err) {
                    this.setState({ loading: false, disabled: false });
                    setError("fatal", err.toString())
                    return;
                }
                AsyncStorage.setItem("userToken", token.idToken, err => {
                    if (err) {
                        this.setState({ loading: false, disabled: false });
                        setError("fatal", err.toString())
                        return;
                    }

                    loginAuth(profile.userId, profile.email, profile.phone, (err, user_info) => {
                        if (err) {
                            this.setState({ loading: false, disabled: false });
                            console.error("Error caught at loginAuth", err);
                            setError("fatal", err.toString())
                            return
                        }
                        const newProfile = Object.assign({}, profile, {
                            user_id: user_info.user_id
                            , auth_id: profile.userId
                            , email: user_info.email
                            , opt_in_email: user_info.opt_in_email
                            , phone: user_info.phone
                            , opt_in_phone: user_info.opt_in_phone
                            , opt_in_notified: user_info.opt_in_notified
                            , card: user_info.card
                            , cc_warning: user_info.cc_warning
                        });

                        login(newProfile);

                        const needsEmail = this._needsEmail(newProfile.email, newProfile.opt_in_email);
                        const needsPhone = this._needsPhone(newProfile.phone, newProfile.opt_in_phone);
                        const needsCC = !newProfile.card.valid;
                        const notNotifiedOfNoCC = !user_info.cc_warning
                        // TODO: Warn that user should create a CC.

                        //Call setState before transferring to a new scene, or you get an error
                        // explaining you can't call setState on an unmounted component.
                        this.setState({ loading: false, disabled: false });

                        if (!user_info.opt_in_notified) {
                            mainNavigator.push({
                                name: r.OPTNOTIFICATION
                            });
                        } else if (needsEmail) {
                            mainNavigator.push({
                                name: r.UPDATEEMAIL
                                , passProps: { needsPhone }
                            });
                        } else if (needsPhone) {
                            mainNavigator.push({
                                name: r.UPDATEPHONE
                            });
                        } else if (needsCC && notNotifiedOfNoCC) {
                            mainNavigator.push({
                                name: r.PROMPTCC
                            });
                        } else {
                            mainNavigator.push({
                                name: r.FINDEVENT
                                , passProps: { profile, token }
                            });
                        }
                    })
                });
            });
        }

        render() {
            return (
                <View style={styles.container}>
                    <View style={styles.messageBox}>
                        <Text style={styles.title}>BidSmart</Text>
                        <Text style={styles.subtitle}>Bidding, made simple.</Text>
                    </View>
                    <ActivityIndicator animating={this.state.loading}/>
                    <Button text={"Log In"} onPress={this._onLogin.bind(this) }/>
                </View>
            )
        }

        componentWillMount() {
            console.log(this.props)
            websocket.setNavigator(this.props.mainNavigator);
            websocket.connect();
        }
    }

    const styles = StyleSheet.create({
        container: {
            flex: 1
            , flexDirection: 'column'
            , justifyContent: 'center'
            , backgroundColor: '#FFF'
        }
        , messageBox: {
            flex: 1
            , justifyContent: 'center'
        }
        , badge: {
            alignSelf: 'center'
            , height: 169
            , width: 151
        }
        , title: {
            fontSize: 50
            , textAlign: 'center'
            , marginTop: 8
            , color: '#353436'
            , fontFamily: 'avenir next'
        }
        , subtitle: {
            fontSize: 17
            , textAlign: 'center'
            , marginTop: 4
            , color: 'grey'
            , fontFamily: 'avenir next'
        }
    });

    //Object.assign({}, {mainNavigator: props.mainNavigator}, props)
    const mapStateToProps = (state, props) => ({
        mainNavigator: props.mainNavigator
    })
    const mapDispatchToProps = dispatch => ({
        login: profile => {
            dispatch(loginBidder(profile))
        }
        , setError: (lvl, msg) => dispatch(setError(lvl, msg))
    });

    export default connect(mapStateToProps, mapDispatchToProps)(AuthLogin);

Bypassing the lock UI

Is there a way to bypass the lock UI and directly authenticate with a social provider?

In my app, I have buttons 'login to Facebook', and I hope to be able to have the user not need to tap twice (once on login to Facebook, then on Auth0's login to Facebook button).

How to use lock.usersAPI?

I want to add 'myData': { first: false, second: true, third: 'Bubbles'} to a user's user_metadata

      const token = this.state.token.idToken;
      lock.usersAPI(token)
        .patch(this.state.profile.identities.user_id, {
          'myData': data,
        })
        .then(response => console.log(response))
        .catch(error => console.log(error));

Error returned via console.log(error): must supply an identifier of the user to be updated

Can you provide more detail on which tokens/user_id it's looking for, and the correct usage of the lock.usersAPI() call?

Support for i18n

I need the login screen in different languages, is it possible right now ?

How to get id token after logged in ????

Hello all,

I can able to login by using this code

lock.show({}, () => {
});

but I need id_token for further authentication I tried with this

lock.show({}, (err, profile, token) => {
  console.log(token);
  console.log('Logged in!');
});

but it showing err,profile and token is undefined.
Could anybody please help in this scenario?

Add custom login option

How do I add a custom login button from a generic OAuth1 connection in my React Native Android app?

Enable / Disable Signup

The README shows a button for signup on the lock, but my lock does not show this option. How do I expose the signup option?

image

Error linking react-native-lock with iOS

I'm trying to install react-native-lock into my existing react native project but am getting this error when trying to run rnpm link react-native-lock:

dwilt:gjs-app dwilt$ rnpm link react-native-lock
Preparing to link react-native-lock for iOS
Checking CocoaPods...
CocoaPods already installed
rnpm-link info Linking react-native-lock android dependency 
rnpm-link info Android module react-native-lock has been successfully linked 
rnpm-link ERR! It seems something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/dwilt/Projects/GJS/gjs-app/ios/AirshipKit/AirshipKit.xcodeproj/project.pbxproj' 
Please file an issue here: https://github.com/rnpm/rnpm/issues 

Build fails with vanilla project

Steps to recreate problem:

  1. react-native init upool
  2. cd upool
  3. In Xcode, change Bundle Identifier to com.upool
  4. npm install --save react-native-lock
  5. rnpm link react-native-lock
  6. Get typical warnings mentioned in the documentation.
  7. Change Other Linker Flags to $(inherited).
  8. rnpm link react-native-lock again. This time with no warnings.
  9. react-native run-ios

react-native-cli: 0.2.0
react-native: 0.27.1
CocoaPods 1.0.1
npm 3.9.2
Xcode 7.3.1

The build error mentions my Info.plist file. Under Bundle identifier in that file, I have $(PRODUCT_BUNDLE_IDENTIFIER)

** BUILD FAILED **

The following commands produced analyzer issues:
Analyze Modules/RCTUIManager.m
(1 command with analyzer issues)

The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/upool.app/upool normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/upool.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/nomad/Mobile/upool/node_modules/promise/lib/done.js:10
throw err;
^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/upool.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

at checkExecSyncError (child_process.js:475:13)
at Object.execFileSync (child_process.js:495:13)
at _runIOS (runIOS.js:91:34)
at runIOS.js:24:5
at tryCallTwo (/Users/nomad/Mobile/upool/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/nomad/Mobile/upool/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/nomad/Mobile/upool/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (runIOS.js:23:10)
at Object.run (/Users/nomad/Mobile/upool/node_modules/react-native/local-cli/cli.js:87:13)
at Object.<anonymous> (/Users/nomad/.npm-packages/lib/node_modules/react-native-cli/index.js:88:7)

Callback not firing

I have ran into the issue of the lock.show() callback not firing on the first authentication attempt. The screen slides down and I am presented with a white screen, if I reload my simulator it will show the lock screen again and if I re-auth the call back will fire.

Any ideas?

How to add Lock.framework?

Hi all,
I tried install react-native-lock for my project. To step 2. Change to the A0RNLock.xcodeproj target tab Build Phases, and in the section Link Binary with Libraries click the + and add Lock.framework and make sure it's Status is set to optional.
I use ios 9.3 when I click to + but not exist Lock.framework. How to add Lock.framework?
Thanks.

48 duplicate symbols for architecture x86_64

Ld /Users/mac/Library/Developer/Xcode/DerivedData/Soie-drazaefwicwmvjcwxyfxnicdkigb/Build/Products/Debug-iphonesimulator/Soie.app/Soie normal x86_64
cd "/Users/mac/Documents/imp Code/Soie 5th August "
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/mac/Library/Developer/Xcode/DerivedData/Soie-drazaefwicwmvjcwxyfxnicdkigb/Build/Products/Debug-iphonesimulator -L/Users/mac/Documents/imp\ Code/Soie\ 5th\ August\ /Soie/PaymentsSDK -L/Users/mac/Documents/imp\ Code/Soie\ 5th\ August\ /Soie/Utilities -F/Users/mac/Library/Developer/Xcode/DerivedData/Soie-drazaefwicwmvjcwxyfxnicdkigb/Build/Products/Debug-iphonesimulator -F/Users/mac/Documents/imp\ Code/Soie\ 5th\ August\ /Soie -filelist /Users/mac/Library/Developer/Xcode/DerivedData/Soie-drazaefwicwmvjcwxyfxnicdkigb/Build/Intermediates/Soie.build/Debug-iphonesimulator/Soie.build/Objects-normal/x86_64/Soie.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -framework FacebookSDK -lsqlite3.0 -lz -framework CoreTelephony -framework Accelerate -framework QuartzCore -framework CoreData -lAdIdAccess -lPaymentsSDK -framework SystemConfiguration -lGoogleAnalyticsServices -Xlinker -dependency_info -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/Soie-drazaefwicwmvjcwxyfxnicdkigb/Build/Intermediates/Soie.build/Debug-iphonesimulator/Soie.build/Objects-normal/x86_64/Soie_dependency_info.dat -o /Users/mac/Library/Developer/Xcode/DerivedData/Soie-drazaefwicwmvjcwxyfxnicdkigb/Build/Products/Debug-iphonesimulator/Soie.app/Soie

duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIUtil.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIUtil.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIEcommerceFields.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIEcommerceFields.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIDefaultLogger.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIDefaultLogger.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAITrackerImpl.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAITrackerImpl.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIDataStore.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIDataStore.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIHitFormat.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIHitFormat.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIHitUtil.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIHitUtil.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIRequestBuilder.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIRequestBuilder.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIStringUtil.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIStringUtil.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAICampaign.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAICampaign.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIURLConnection.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIURLConnection.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAITrackedViewController.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAITrackedViewController.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIReachabilityChecker.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIReachabilityChecker.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIUncaughtExceptionHandler.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIUncaughtExceptionHandler.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIExceptionParser.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIExceptionParser.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIFields.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIFields.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIDictionaryBuilder.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIDictionaryBuilder.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAITrackerModel.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAITrackerModel.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIBatchingDispatcher.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIBatchingDispatcher.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIUsageTracker.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIUsageTracker.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAISqlStore.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAISqlStore.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAICompressionUtil.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAICompressionUtil.o)
duplicate symbol _llvm.cmdline in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
duplicate symbol _llvm.embedded.module in:
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAI.o)
/Users/mac/Documents/imp Code/Soie 5th August /Soie/Utilities/libGoogleAnalyticsServices.a(GAIAnalyticsPropertiesStore.o)
ld: 48 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have try so many things but this issue is not resolve plz help me..

Add refreshToken method

How do I use the refresh token provided by the show() callback?

each time my app is restarted it requires the user to re-login. Maybe it's obvious, but I've definitely missed it. Thanks!

Cannot build sample-app from repo or any other app following the guide

Hello!
I'm pretty new at this so excuse any obvious errors;

I'm trying to build an app with auth0 and firebase, I've followed the guide here: https://auth0.com/docs/quickstart/native-mobile/react-native-ios/firebase

But there are a number of things that are failing:

  • The Podfile format seems to be wrong, I tried upgrading cocoapods to version 1.0.0.beta.6 to no avail
  • I'm getting the error: 'LockReactNative/A0LockReactModule.h' file not found

Using the Podfile from sample-app/ in this repo installs successfully but if I paste the contents from the guide it will fail.

I'm hoping that resolving #4 will make it easier to use your service. :)

Let me know if you need any other info

Using accessToken for API, userinfo?

After a user logs in, I'm storing the tokens via AsyncStorage and trying to fetch the user's profile upon re-visiting the app.
This appears to be super simple in the Auth0 API docs but I'm getting back the message "Unauthorized" in my app:

async getUserinfo() {
    console.log('getting user info in getUserInfo()');
    try {
      let response = await fetch('https://xxxxx.auth0.com/userinfo', {
        method: 'GET',
        headers: {
          Authorization: 'Bearer ${this.state.token.accessToken}',
        },
      });
      let responseJson = await response.json();
      if(responseJson !== null) {
        console.log('Got user info: ' + responseJson.email);
        this.setState({ component: Temp, isLoading: false, profile: responseJson});
      }
    } catch (error) {
      console.log('Error in retrieving userinfo from Auth0: ' + error.message);
      this.setState({ component: Login, isLoading: false});
    }
  }

What am I missing? I can't find many examples of using fetch with Auth0, is there a better method I should be using?

Valid email is triggering invalid email popup

I think there is a regex pattern issue here. Our client has an email - [email protected] - and when they're trying to login, it's giving an invalid email error:

image
image

"react-native-lock": "^0.3.0",
"react": "15.2.1",
"react-native": "0.28.0",

iOS 9.3 iPhone 6 simulator

Podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target 'GreatJonesStreet' do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for GreatJonesStreet
  pod 'OneSignal'
  pod 'Branch'

  # Auth0 Lock
  pod 'Lock', '~> 1.26'
  pod 'Lock/TouchID'
  pod 'Lock/SMS'
  pod 'Lock/Email'

  target 'GreatJonesStreetTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Node: 5.7.1
NPM: 3.6.0

authParams applied inconsistently

If I call

lock.show({})

with an empty params object, I can log in successfully.

However if I call

lock.show({authParams:{}})

or say

lock.show({authParams:{connection_scopes: {facebook: ['user_posts']}}})

authenticationParametersFromOptions() will build a parameter dictionary that is missing the 'device' item, which causes login to fail.

I need to explicitly pass in scope to make it work

lock.show({authParams:{scope: 'openid offline_access', connection_scopes: {facebook: ['user_posts']}}})

This is very confusing to a new user.

Additionally, the connection_scopes are totally ignored by A0WebViewAuthenticator - it seems that for other IDPs the params get the 'connection' property set (in registerAuthenticationProvider):

params[A0ParameterConnection] = connectionName;

But this is not set for A0WebViewAuthenticator. Subsequently, when A0WebKitViewController.initWithAPIClient is called, [parameters asAPIPayload] returns a parameter dictionary with connection_scopes missing, because it is trying to look up the connection scopes for the selected connection, but none is set.

I'll open a separate ticket on Lock.iOS as I believe this second issue is a bug in that project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.