| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | 26-Sep-2023 | - | ||||
| build/ | H | 26-Sep-2023 | - | 3,112 | 1,726 | |
| providers/ | H | 26-Sep-2023 | - | 8 | 4 | |
| src/ | H | 26-Sep-2023 | - | 4,019 | 2,621 | |
| .eslintrc.js | H A D | 26-Sep-2023 | 103 | 3 | 1 | |
| .npmignore | H A D | 26-Sep-2023 | 183 | 12 | 8 | |
| CHANGELOG.md | H A D | 26-Sep-2023 | 7.6 KiB | 212 | 112 | |
| README.md | H A D | 26-Sep-2023 | 3.4 KiB | 98 | 72 | |
| babel.config.js | H A D | 26-Sep-2023 | 107 | 7 | 6 | |
| package.json | H A D | 26-Sep-2023 | 1.3 KiB | 52 | 51 | |
| tsconfig.json | H A D | 26-Sep-2023 | 217 | 10 | 9 |
README.md
1# expo-auth-session 2 3`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](https://www.npmjs.com/package/expo-web-browser). 4 5# API documentation 6 7- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/auth-session.mdx) 8- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/auth-session) 9 10# Installation in managed Expo projects 11 12For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/auth-session). 13 14# Installation in bare React Native projects 15 16For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing. 17 18### Add the package to your npm dependencies 19 20``` 21npx expo install expo-auth-session expo-crypto 22``` 23 24### Configuration 25 26To use this module, you need to set up React Native deep linking in your application. For more information, check out [React Native documentation](https://reactnative.dev/docs/linking). 27 28#### Add support for React Native deep linking 29 30- **Android**: 31 32 Add intent filter and set the `launchMode` of your MainActivity to `singleTask` in `AndroidManifest.yml`: 33 34 ```xml 35 <activity 36 android:name=".MainActivity" 37 android:launchMode="singleTask"> 38 <intent-filter> 39 <action android:name="android.intent.action.VIEW" /> 40 <category android:name="android.intent.category.DEFAULT" /> 41 <category android:name="android.intent.category.BROWSABLE" /> 42 <!-- Accepts URIs that begin with "example://gizmos” --> 43 <data android:scheme="example" 44 android:host="gizmos" /> 45 </intent-filter> 46 ``` 47 48 For more information about the available configuration, check out [Android documentation](https://developer.android.com/training/app-links/deep-linking#adding-filters). 49 50* **iOS**: 51 52 Add following lines to your `AppDelegate.m`: 53 54 ```obj-c 55 #import <React/RCTLinkingManager.h> 56 57 // iOS 9.x or newer 58 - (BOOL)application:(UIApplication *)application 59 openURL:(NSURL *)url 60 options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options 61 { 62 return [RCTLinkingManager application:application openURL:url options:options]; 63 } 64 65 // iOS 8.x or older 66 - (BOOL)application:(UIApplication *)application 67 openURL:(NSURL *)url 68 sourceApplication:(NSString *)sourceApplication 69 annotation:(id)annotation 70 { 71 return [RCTLinkingManager application:application openURL:url 72 sourceApplication:sourceApplication annotation:annotation]; 73 } 74 ``` 75 76 Add following lines to `Info.plist`: 77 78 ```xml 79 <dict> 80 ... 81 <key>CFBundleURLTypes</key> 82 <array> 83 <dict> 84 <key>CFBundleURLName</key> 85 <string>gizmos</string> 86 <key>CFBundleURLSchemes</key> 87 <array> 88 <string>example</string> 89 </array> 90 </dict> 91 </array> 92 </dict> 93 ``` 94 95# Contributing 96 97Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing). 98