Package detail

@stevesouth/expo-auth-session

expo29MIT3.5.1

Expo module for browser-based authentication

react-native, expo, expo-auth-session, auth

readme

expo-auth-session

AuthSession is the easiest way to implement web browser based authentication (for example, browser-based OAuth flows) to your app, built on top of expo-web-browser.

API documentation

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

expo install expo-auth-session expo-random

Configuration

To use this module, you need to set up React Native deep linking in your application. For more information, check out React Native documentation.

Add support for React Native deep linking

  • Android:

    Add intent filter and set the launchMode of your MainActivity to singleTask in AndroidManifest.yml:

    <activity
        android:name=".MainActivity"
        android:launchMode="singleTask">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <!-- Accepts URIs that begin with "example://gizmos” -->
            <data android:scheme="example"
                android:host="gizmos" />
        </intent-filter>
    

    For more information about the available configuration, check out Android documentation.

  • iOS:

    Add following lines to your AppDelegate.m:

    #import <React/RCTLinkingManager.h>
    
    // iOS 9.x or newer
    - (BOOL)application:(UIApplication *)application
                openURL:(NSURL *)url
                options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
    {
        return [RCTLinkingManager application:application openURL:url options:options];
    }
    
    // iOS 8.x or older
    - (BOOL)application:(UIApplication *)application
                openURL:(NSURL *)url
      sourceApplication:(NSString *)sourceApplication
             annotation:(id)annotation
    {
        return [RCTLinkingManager application:application openURL:url
                        sourceApplication:sourceApplication annotation:annotation];
    }
    

    Add following lines to Info.plist:

    <dict>
        ...
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleURLName</key>
                <string>gizmos</string>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>example</string>
                </array>
            </dict>
        </array>
    </dict>
    

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

changelog

Changelog

Unpublished

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

💡 Others

3.5.0 — 2021-12-03

This version does not introduce any user-facing changes.

3.4.1 — 2021-10-01

🐛 Bug fixes

  • Fixed an import from deprecated @unimodules/react-native-adapter package. (#14585 by @tsapeta)

3.4.0 — 2021-09-28

🎉 New features

  • Update JS code to read manifest2 when manifest is not available. (#13602 by @wschurman)

3.3.0 — 2021-06-16

🐛 Bug fixes

3.2.3 — 2021-04-13

This version does not introduce any user-facing changes.

3.2.2 — 2021-04-09

🎉 New features

3.2.1 — 2021-03-30

This version does not introduce any user-facing changes.

3.2.0 — 2021-03-10

🎉 New features

🐛 Bug fixes

  • Remove peerDependencies and unimodulePeerDependencies from Expo modules. (#11980 by @brentvatne)
  • Fix dependencies to align with bundledNativeModules.json. (#12113 by @brentvatne)

3.1.0 — 2021-01-15

This version does not introduce any user-facing changes.

3.0.0 — 2020-12-09

🛠 Breaking changes

2.0.1 — 2020-11-17

🐛 Bug fixes

  • Improved mechanism used to determine whether in bare or managed workflow. (#10993 by @esamelson)

2.0.0 — 2020-09-22

This version does not introduce any user-facing changes.

1.5.0 — 2020-08-26

🎉 New features

  • Create built-in providers/google for easy Google auth. (#9361 by @EvanBacon)
  • Create built-in providers/facebook for easy Facebook auth. (#9361 by @EvanBacon)

1.4.2 — 2020-08-18

This version does not introduce any user-facing changes.

1.4.1 — 2020-06-23

🎉 New features

🐛 Bug fixes

  • Added custom Platform.isDOMAvailable pending @unimodules/react-native-adapter update. (#8934 by @EvanBacon)

1.4.0 — 2020-06-23

🎉 New features

1.3.1 — 2020-05-29

This version does not introduce any user-facing changes.

1.3.0 — 2020-05-27

🐛 Bug fixes

  • Fix AuthSession.getDefaultReturnUrl() returning wrong URL while using release channels. (#7687 by @lukmccall)
  • Fixed a bug where the useAutoDiscovery() hook hadn't finished before a component was unmounted. There was no cleanup, so when the fetch request completed, a react state update was attempted on an unmounted component. (#12491 by @andrew1601)