├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── Bug Report.yml
│ ├── Feature Request.yml
│ └── config.yml
├── dependabot.yml
├── stale.yml
└── workflows
│ └── semgrep.yml
├── .gitignore
├── 00-Login-Expo
├── .gitignore
├── App.js
├── README.md
├── app.json
├── assets
│ ├── adaptive-icon.png
│ ├── favicon.png
│ ├── icon.png
│ └── splash-icon.png
├── auth0-configuration.js.example
├── index.js
├── package.json
└── yarn.lock
├── 00-Login-Hooks
├── .bundle
│ └── config
├── .eslintrc.js
├── .gitignore
├── .prettierrc.js
├── .watchmanconfig
├── App.tsx
├── Gemfile
├── Gemfile.lock
├── README.md
├── __tests__
│ └── App.test.tsx
├── android
│ ├── app
│ │ ├── build.gradle
│ │ ├── debug.keystore
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── auth0samples
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── MainApplication.kt
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── rn_edit_text_material.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── app.json
├── auth0-configuration.js.example
├── babel.config.js
├── index.js
├── ios
│ ├── .xcode.env
│ ├── Auth0Sample.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Auth0Sample.xcscheme
│ ├── Auth0Sample.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── Auth0Sample
│ │ ├── AppDelegate.swift
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── PrivacyInfo.xcprivacy
│ ├── Podfile
│ └── Podfile.lock
├── jest.config.js
├── metro.config.js
├── package.json
└── tsconfig.json
├── 00-Login
├── .bundle
│ └── config
├── .eslintrc.js
├── .gitignore
├── .prettierrc.js
├── .watchmanconfig
├── App.tsx
├── Gemfile
├── Gemfile.lock
├── README.md
├── __tests__
│ └── App.test.tsx
├── android
│ ├── app
│ │ ├── build.gradle
│ │ ├── debug.keystore
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── auth0samples
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── MainApplication.kt
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── rn_edit_text_material.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── app.json
├── auth0-configuration.js.example
├── babel.config.js
├── index.js
├── ios
│ ├── .xcode.env
│ ├── Auth0Sample.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Auth0Sample.xcscheme
│ ├── Auth0Sample.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── Auth0Sample
│ │ ├── AppDelegate.swift
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── PrivacyInfo.xcprivacy
│ ├── Podfile
│ └── Podfile.lock
├── jest.config.js
├── metro.config.js
├── package.json
└── tsconfig.json
├── LICENSE
└── README.md
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @auth0-samples/project-dx-sdks-engineer-codeowner
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Bug Report.yml:
--------------------------------------------------------------------------------
1 | name: 🐞 Report a bug
2 | description: Have you found a bug or issue? Create a bug report for this sample
3 |
4 | body:
5 | - type: markdown
6 | attributes:
7 | value: |
8 | **Please do not report security vulnerabilities here**. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.
9 |
10 | - type: checkboxes
11 | id: checklist
12 | attributes:
13 | label: Checklist
14 | options:
15 | - label: I have looked into the Readme ([Base](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login#readme)/[Hooks](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login-Hooks#readme)/[Expo](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login-Expo#readme)) and have not found a suitable solution or answer.
16 | required: true
17 | - label: I have searched the [issues](https://github.com/auth0-samples/auth0-react-native-sample/issues) and have not found a suitable solution or answer.
18 | required: true
19 | - label: I have searched the [Auth0 Community](https://community.auth0.com) forums and have not found a suitable solution or answer.
20 | required: true
21 | - label: I agree to the terms within the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).
22 | required: true
23 |
24 | - type: textarea
25 | id: description
26 | attributes:
27 | label: Description
28 | description: Provide a clear and concise description of the issue, including what you expected to happen.
29 | validations:
30 | required: true
31 |
32 | - type: textarea
33 | id: reproduction
34 | attributes:
35 | label: Reproduction
36 | description: Detail the steps taken to reproduce this error, and whether this issue can be reproduced consistently or if it is intermittent.
37 | placeholder: |
38 | 1. Step 1...
39 | 2. Step 2...
40 | 3. ...
41 | validations:
42 | required: true
43 |
44 | - type: textarea
45 | id: additional-context
46 | attributes:
47 | label: Additional context
48 | description: Any other relevant information you think would be useful.
49 | validations:
50 | required: false
51 |
52 | - type: dropdown
53 | id: environment-sample
54 | attributes:
55 | label: Sample
56 | multiple: false
57 | options:
58 | - Base
59 | - Hooks
60 | - Expo
61 | validations:
62 | required: true
63 |
64 | - type: dropdown
65 | id: environment-platform
66 | attributes:
67 | label: Platform
68 | multiple: true
69 | options:
70 | - Android
71 | - iOS
72 | validations:
73 | required: true
74 |
75 | - type: input
76 | id: environment-platform-version
77 | attributes:
78 | label: Platform version(s)
79 | validations:
80 | required: true
81 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Feature Request.yml:
--------------------------------------------------------------------------------
1 | name: 🧩 Feature request
2 | description: Suggest an idea or a feature for this sample
3 | labels: ["feature request"]
4 |
5 | body:
6 | - type: checkboxes
7 | id: checklist
8 | attributes:
9 | label: Checklist
10 | options:
11 | - label: I have looked into the Readme ([Base](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login#readme)/[Hooks](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login-Hooks#readme)/[Expo](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login-Expo#readme)) and have not found a suitable solution or answer.
12 | required: true
13 | - label: I have searched the [issues](https://github.com/auth0-samples/auth0-react-native-sample/issues) and have not found a suitable solution or answer.
14 | required: true
15 | - label: I have searched the [Auth0 Community](https://community.auth0.com) forums and have not found a suitable solution or answer.
16 | required: true
17 | - label: I agree to the terms within the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).
18 | required: true
19 |
20 | - type: textarea
21 | id: description
22 | attributes:
23 | label: Describe the problem you'd like to have solved
24 | description: A clear and concise description of what the problem is.
25 | validations:
26 | required: true
27 |
28 | - type: textarea
29 | id: ideal-solution
30 | attributes:
31 | label: Describe the ideal solution
32 | description: A clear and concise description of what you want to happen.
33 | validations:
34 | required: true
35 |
36 | - type: textarea
37 | id: alternatives-and-workarounds
38 | attributes:
39 | label: Alternatives and current workarounds
40 | description: A clear and concise description of any alternatives you've considered or any workarounds that are currently in place.
41 | validations:
42 | required: false
43 |
44 | - type: textarea
45 | id: additional-context
46 | attributes:
47 | label: Additional context
48 | description: Add any other context or screenshots about the feature request here.
49 | validations:
50 | required: false
51 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: 🤔 Help & Questions
4 | url: https://community.auth0.com
5 | about: Ask general support or usage questions in the Auth0 Community forums.
6 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "npm"
4 | directory: "/00-Login"
5 | schedule:
6 | interval: "daily"
7 | ignore:
8 | - dependency-name: "*"
9 | update-types: ["version-update:semver-major", "version-update:semver-patch"]
10 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Configuration for probot-stale - https://github.com/probot/stale
2 |
3 | # Number of days of inactivity before an Issue or Pull Request becomes stale
4 | daysUntilStale: 90
5 |
6 | # Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7 | daysUntilClose: 7
8 |
9 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
10 | exemptLabels: []
11 |
12 | # Set to true to ignore issues with an assignee (defaults to false)
13 | exemptAssignees: true
14 |
15 | # Label to use when marking as stale
16 | staleLabel: closed:stale
17 |
18 | # Comment to post when marking as stale. Set to `false` to disable
19 | markComment: >
20 | This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇♂️
--------------------------------------------------------------------------------
/.github/workflows/semgrep.yml:
--------------------------------------------------------------------------------
1 | name: Semgrep
2 |
3 | on:
4 | pull_request: {}
5 |
6 | push:
7 | branches: ["master", "main"]
8 |
9 | schedule:
10 | - cron: '30 0 1,15 * *'
11 |
12 | jobs:
13 | semgrep:
14 | name: Scan
15 | runs-on: ubuntu-latest
16 | container:
17 | image: returntocorp/semgrep
18 | # Skip any PR created by dependabot to avoid permission issues
19 | if: (github.actor != 'dependabot[bot]')
20 | steps:
21 | - uses: actions/checkout@v3
22 |
23 | - run: semgrep ci
24 | env:
25 | SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Auth0
6 | Auth0.plist
7 | !Auth0Tests/Auth0.plist
8 |
9 | # Xcode
10 | #
11 | build/
12 | *.pbxuser
13 | !default.pbxuser
14 | *.mode1v3
15 | !default.mode1v3
16 | *.mode2v3
17 | !default.mode2v3
18 | *.perspectivev3
19 | !default.perspectivev3
20 | xcuserdata
21 | *.xccheckout
22 | *.moved-aside
23 | DerivedData
24 | *.hmap
25 | *.ipa
26 | *.xcuserstate
27 |
28 | # Android/IntelliJ
29 | #
30 | build/
31 | .idea
32 | .gradle
33 | local.properties
34 | *.iml
35 |
36 | # node.js
37 | #
38 | node_modules/
39 | npm-debug.log
40 | yarn-error.log
41 |
42 | # BUCK
43 | buck-out/
44 | \.buckd/
45 | *.keystore
46 | !debug.keystore
47 |
48 | # fastlane
49 | #
50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
51 | # screenshots whenever they are needed.
52 | # For more information about the recommended setup visit:
53 | # https://docs.fastlane.tools/best-practices/source-control/
54 |
55 | */fastlane/report.xml
56 | */fastlane/Preview.html
57 | */fastlane/screenshots
58 |
59 | # Bundle artifact
60 | *.jsbundle
61 |
62 | # CocoaPods
63 | /ios/Pods/
64 | auth0-configuration.js
65 |
--------------------------------------------------------------------------------
/00-Login-Expo/.gitignore:
--------------------------------------------------------------------------------
1 | # Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2 |
3 | # dependencies
4 | node_modules/
5 |
6 | # Expo
7 | .expo/
8 | dist/
9 | web-build/
10 | expo-env.d.ts
11 |
12 | # Native
13 | .kotlin/
14 | *.orig.*
15 | *.jks
16 | *.p8
17 | *.p12
18 | *.key
19 | *.mobileprovision
20 |
21 | # Metro
22 | .metro-health-check*
23 |
24 | # debug
25 | npm-debug.*
26 | yarn-debug.*
27 | yarn-error.*
28 |
29 | # macOS
30 | .DS_Store
31 | *.pem
32 |
33 | # local env files
34 | .env*.local
35 |
36 | # typescript
37 | *.tsbuildinfo
38 |
--------------------------------------------------------------------------------
/00-Login-Expo/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {Alert, Button, StyleSheet, Text, View} from 'react-native';
3 | import {useAuth0, Auth0Provider} from 'react-native-auth0';
4 | import config from './auth0-configuration';
5 |
6 | const Home = () => {
7 | const {authorize, clearSession, user, error, getCredentials, isLoading} = useAuth0();
8 |
9 | const onLogin = async () => {
10 | try {
11 | await authorize();
12 | let credentials = await getCredentials();
13 | Alert.alert('AccessToken: ' + credentials.accessToken);
14 | } catch (e) {
15 | console.log(e);
16 | }
17 | };
18 |
19 | const loggedIn = user !== undefined && user !== null;
20 |
21 | const onLogout = async () => {
22 | try {
23 | await clearSession();
24 | } catch (e) {
25 | console.log('Log out cancelled');
26 | }
27 | };
28 |
29 | if (isLoading) {
30 | return Loading;
31 | }
32 |
33 | return (
34 |
35 | Auth0Sample - Login
36 | {user && You are logged in as {user.name}}
37 | {!user && You are not logged in}
38 | {error && {error.message}}
39 |
43 |
44 | );
45 | };
46 |
47 | const App = () => {
48 | return (
49 |
50 |
51 |
52 | );
53 | };
54 |
55 | const styles = StyleSheet.create({
56 | container: {
57 | flex: 1,
58 | justifyContent: 'center',
59 | alignItems: 'center',
60 | backgroundColor: '#F5FCFF',
61 | },
62 | header: {
63 | fontSize: 20,
64 | textAlign: 'center',
65 | margin: 10,
66 | },
67 | });
68 |
69 | export default App;
--------------------------------------------------------------------------------
/00-Login-Expo/README.md:
--------------------------------------------------------------------------------
1 | # Auth0 React Native - E Samples - Login
2 |
3 | The complete guide to getting started with [react-native-auth0](https://github.com/auth0/react-native-auth0) is our [Expo QuickStart](https://auth0.com/docs/quickstart/native/react-native-expo/interactive).
4 |
5 | > **Warning**
6 | > This SDK is not compatible with "Expo Go" app. It is compatible only with Custom Dev Client and EAS builds.
7 |
8 | ## 1. Install
9 |
10 | Clone the repository and install the dependencies with [Yarn](https://yarnpkg.com):
11 |
12 | ```bash
13 | git clone git@github.com:auth0-samples/auth0-react-native-sample.git
14 | cd auth0-react-native-sample/00-login-expo
15 | yarn install
16 | ```
17 |
18 | ### Android applications only
19 |
20 | Open the `app.json` file and locate the following plugin configuration:
21 |
22 | ```json
23 | "plugins": [
24 | [
25 | "react-native-auth0",
26 | {
27 | "domain": "{DOMAIN}"
28 |
29 | }
30 | ]
31 | ]
32 | ```
33 |
34 | Replace `{DOMAIN}` with your Auth0 domain value. If you have `samples.auth0.com` as your Auth0 domain you would have a configuration like the following:
35 |
36 | ```json
37 | "plugins": [
38 | [
39 | "react-native-auth0",
40 | {
41 | "domain": "samples.auth0.com"
42 | }
43 | ]
44 | ]
45 | ```
46 |
47 | ## 2. Configure Auth0
48 |
49 | 1. Copy the `app/auth0-configuration.js.example` in this sample to `app/auth0-configuration.js`.
50 | 2. Open your [Applications in the Auth0 dashboard](https://manage.auth0.com/#/applications).
51 | 3. Select your existing Application from the list or click **Create Application** at the top to create a new Application of type **Native**.
52 | 4. On the **Settings** tab for the Application, copy the "Client ID" and "Domain" values and paste them into the `app/auth0-configuration.js` file created above.
53 | 5. In the **Allowed Callback URLs** field, paste in the text below and replace `YOUR_DOMAIN` with the **Domain** from above. These URLs are required for the authentication result to be redirected from the browser to the app:
54 |
55 | ```
56 | com.auth0samples.auth0://YOUR_DOMAIN/ios/com.auth0samples/callback,
57 | com.auth0samples.auth0://YOUR_DOMAIN/android/com.auth0samples/callback
58 | ```
59 |
60 | 6. Add the same values to the **Allowed Logout URLs** field as well. These are required for the browser to redirect back to the app after the user logs out.
61 | 7. Scroll down and click **Save Changes**.
62 |
63 | ## 3. Run The App
64 |
65 | Run your app on an emulator, simulator, or your own connected device.
66 |
67 | - To run the app on iOS run `expo run:ios`.
68 | - To run the app on Android run `expo run:android`.
69 |
70 | The first run may take a while to fully launch. Keep an eye out for confirmation windows and watch the terminal for output and results.
71 |
--------------------------------------------------------------------------------
/00-Login-Expo/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "expo": {
3 | "name": "00-Login-Expo",
4 | "slug": "00-Login-Expo",
5 | "version": "1.0.0",
6 | "orientation": "portrait",
7 | "icon": "./assets/icon.png",
8 | "userInterfaceStyle": "light",
9 | "newArchEnabled": true,
10 | "plugins": [
11 | [
12 | "react-native-auth0",
13 | {
14 | "domain": "{DOMAIN}"
15 | }
16 | ]
17 | ],
18 | "splash": {
19 | "image": "./assets/splash-icon.png",
20 | "resizeMode": "contain",
21 | "backgroundColor": "#ffffff"
22 | },
23 | "ios": {
24 | "supportsTablet": true,
25 | "bundleIdentifier": "com.auth0samples"
26 | },
27 | "android": {
28 | "adaptiveIcon": {
29 | "foregroundImage": "./assets/adaptive-icon.png",
30 | "backgroundColor": "#ffffff"
31 | },
32 | "edgeToEdgeEnabled": true,
33 | "package": "com.auth0samples"
34 | },
35 | "web": {
36 | "favicon": "./assets/favicon.png"
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/00-Login-Expo/assets/adaptive-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Expo/assets/adaptive-icon.png
--------------------------------------------------------------------------------
/00-Login-Expo/assets/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Expo/assets/favicon.png
--------------------------------------------------------------------------------
/00-Login-Expo/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Expo/assets/icon.png
--------------------------------------------------------------------------------
/00-Login-Expo/assets/splash-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Expo/assets/splash-icon.png
--------------------------------------------------------------------------------
/00-Login-Expo/auth0-configuration.js.example:
--------------------------------------------------------------------------------
1 | const config = {
2 | clientId: "{CLIENT_ID}",
3 | domain: "{DOMAIN}"
4 | };
5 |
6 | export default config;
--------------------------------------------------------------------------------
/00-Login-Expo/index.js:
--------------------------------------------------------------------------------
1 | import { registerRootComponent } from 'expo';
2 |
3 | import App from './App';
4 |
5 | // registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6 | // It also ensures that whether you load the app in Expo Go or in a native build,
7 | // the environment is set up appropriately
8 | registerRootComponent(App);
9 |
--------------------------------------------------------------------------------
/00-Login-Expo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "00-login-expo",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "scripts": {
6 | "start": "expo start --dev-client",
7 | "android": "expo run:android",
8 | "ios": "expo run:ios",
9 | "web": "expo start --web"
10 | },
11 | "dependencies": {
12 | "expo": "~53.0.9",
13 | "expo-dev-client": "~5.1.8",
14 | "expo-status-bar": "~2.2.3",
15 | "react": "19.0.0",
16 | "react-native": "0.79.2",
17 | "react-native-auth0": "^5.0.0-beta.1"
18 | },
19 | "devDependencies": {
20 | "@babel/core": "^7.20.0"
21 | },
22 | "private": true
23 | }
24 |
--------------------------------------------------------------------------------
/00-Login-Hooks/.bundle/config:
--------------------------------------------------------------------------------
1 | BUNDLE_PATH: "vendor/bundle"
2 | BUNDLE_FORCE_RUBY_PLATFORM: 1
3 |
--------------------------------------------------------------------------------
/00-Login-Hooks/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: '@react-native',
4 | };
5 |
--------------------------------------------------------------------------------
/00-Login-Hooks/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | **/.xcode.env.local
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 | *.hprof
33 | .cxx/
34 | *.keystore
35 | !debug.keystore
36 | .kotlin/
37 |
38 | # node.js
39 | #
40 | node_modules/
41 | npm-debug.log
42 | yarn-error.log
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | **/fastlane/report.xml
52 | **/fastlane/Preview.html
53 | **/fastlane/screenshots
54 | **/fastlane/test_output
55 |
56 | # Bundle artifact
57 | *.jsbundle
58 |
59 | # Ruby / CocoaPods
60 | **/Pods/
61 | /vendor/bundle/
62 |
63 | # Temporary files created by Metro to check the health of the file watcher
64 | .metro-health-check*
65 |
66 | # testing
67 | /coverage
68 |
69 | # Yarn
70 | .yarn/*
71 | !.yarn/patches
72 | !.yarn/plugins
73 | !.yarn/releases
74 | !.yarn/sdks
75 | !.yarn/versions
76 |
--------------------------------------------------------------------------------
/00-Login-Hooks/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | arrowParens: 'avoid',
3 | bracketSameLine: true,
4 | bracketSpacing: false,
5 | singleQuote: true,
6 | trailingComma: 'all',
7 | };
8 |
--------------------------------------------------------------------------------
/00-Login-Hooks/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/00-Login-Hooks/App.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | * @flow strict-local
7 | */
8 |
9 | import React from 'react';
10 | import {Alert, Button, StyleSheet, Text, View} from 'react-native';
11 | import {useAuth0, Auth0Provider} from 'react-native-auth0';
12 | import config from './auth0-configuration';
13 |
14 | const Home = () => {
15 | const {authorize, clearSession, user, getCredentials, error, isLoading} = useAuth0();
16 |
17 | const onLogin = async () => {
18 | await authorize({}, {});
19 | const credentials = await getCredentials();
20 | Alert.alert('AccessToken: ' + credentials?.accessToken);
21 | };
22 |
23 | const loggedIn = user !== undefined && user !== null;
24 |
25 | const onLogout = async () => {
26 | await clearSession({}, {});
27 | };
28 |
29 |
30 | if (isLoading) {
31 | return Loading;
32 | }
33 |
34 | return (
35 |
36 | Auth0Sample - Login
37 | {user && You are logged in as {user.name}}
38 | {!user && You are not logged in}
39 |
43 | {error && {error.message}}
44 |
45 | );
46 | };
47 |
48 | const App = () => {
49 | return (
50 |
51 |
52 |
53 | );
54 | };
55 |
56 | const styles = StyleSheet.create({
57 | container: {
58 | flex: 1,
59 | justifyContent: 'center',
60 | alignItems: 'center',
61 | backgroundColor: '#F5FCFF',
62 | },
63 | header: {
64 | fontSize: 20,
65 | textAlign: 'center',
66 | margin: 10,
67 | },
68 | error: {
69 | margin: 20,
70 | textAlign: 'center',
71 | color: '#D8000C'
72 | }
73 | });
74 |
75 | export default App;
--------------------------------------------------------------------------------
/00-Login-Hooks/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4 | ruby ">= 2.6.10"
5 |
6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures.
7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9 | gem 'xcodeproj', '< 1.26.0'
10 | gem 'concurrent-ruby', '< 1.3.4'
11 |
12 | # Ruby 3.4.0 has removed some libraries from the standard library.
13 | gem 'bigdecimal'
14 | gem 'logger'
15 | gem 'benchmark'
16 | gem 'mutex_m'
17 |
--------------------------------------------------------------------------------
/00-Login-Hooks/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.7)
5 | base64
6 | nkf
7 | rexml
8 | activesupport (6.1.7.10)
9 | concurrent-ruby (~> 1.0, >= 1.0.2)
10 | i18n (>= 1.6, < 2)
11 | minitest (>= 5.1)
12 | tzinfo (~> 2.0)
13 | zeitwerk (~> 2.3)
14 | addressable (2.8.7)
15 | public_suffix (>= 2.0.2, < 7.0)
16 | algoliasearch (1.27.5)
17 | httpclient (~> 2.8, >= 2.8.3)
18 | json (>= 1.5.1)
19 | atomos (0.1.3)
20 | base64 (0.2.0)
21 | benchmark (0.4.0)
22 | bigdecimal (3.1.9)
23 | claide (1.1.0)
24 | cocoapods (1.15.2)
25 | addressable (~> 2.8)
26 | claide (>= 1.0.2, < 2.0)
27 | cocoapods-core (= 1.15.2)
28 | cocoapods-deintegrate (>= 1.0.3, < 2.0)
29 | cocoapods-downloader (>= 2.1, < 3.0)
30 | cocoapods-plugins (>= 1.0.0, < 2.0)
31 | cocoapods-search (>= 1.0.0, < 2.0)
32 | cocoapods-trunk (>= 1.6.0, < 2.0)
33 | cocoapods-try (>= 1.1.0, < 2.0)
34 | colored2 (~> 3.1)
35 | escape (~> 0.0.4)
36 | fourflusher (>= 2.3.0, < 3.0)
37 | gh_inspector (~> 1.0)
38 | molinillo (~> 0.8.0)
39 | nap (~> 1.0)
40 | ruby-macho (>= 2.3.0, < 3.0)
41 | xcodeproj (>= 1.23.0, < 2.0)
42 | cocoapods-core (1.15.2)
43 | activesupport (>= 5.0, < 8)
44 | addressable (~> 2.8)
45 | algoliasearch (~> 1.0)
46 | concurrent-ruby (~> 1.1)
47 | fuzzy_match (~> 2.0.4)
48 | nap (~> 1.0)
49 | netrc (~> 0.11)
50 | public_suffix (~> 4.0)
51 | typhoeus (~> 1.0)
52 | cocoapods-deintegrate (1.0.5)
53 | cocoapods-downloader (2.1)
54 | cocoapods-plugins (1.0.0)
55 | nap
56 | cocoapods-search (1.0.1)
57 | cocoapods-trunk (1.6.0)
58 | nap (>= 0.8, < 2.0)
59 | netrc (~> 0.11)
60 | cocoapods-try (1.2.0)
61 | colored2 (3.1.2)
62 | concurrent-ruby (1.3.3)
63 | escape (0.0.4)
64 | ethon (0.16.0)
65 | ffi (>= 1.15.0)
66 | ffi (1.17.2)
67 | fourflusher (2.3.1)
68 | fuzzy_match (2.0.4)
69 | gh_inspector (1.1.3)
70 | httpclient (2.9.0)
71 | mutex_m
72 | i18n (1.14.7)
73 | concurrent-ruby (~> 1.0)
74 | json (2.7.6)
75 | logger (1.7.0)
76 | minitest (5.25.4)
77 | molinillo (0.8.0)
78 | mutex_m (0.3.0)
79 | nanaimo (0.3.0)
80 | nap (1.1.0)
81 | netrc (0.11.0)
82 | nkf (0.2.0)
83 | public_suffix (4.0.7)
84 | rexml (3.4.1)
85 | ruby-macho (2.5.1)
86 | typhoeus (1.4.1)
87 | ethon (>= 0.9.0)
88 | tzinfo (2.0.6)
89 | concurrent-ruby (~> 1.0)
90 | xcodeproj (1.25.1)
91 | CFPropertyList (>= 2.3.3, < 4.0)
92 | atomos (~> 0.1.3)
93 | claide (>= 1.0.2, < 2.0)
94 | colored2 (~> 3.1)
95 | nanaimo (~> 0.3.0)
96 | rexml (>= 3.3.6, < 4.0)
97 | zeitwerk (2.6.18)
98 |
99 | PLATFORMS
100 | ruby
101 |
102 | DEPENDENCIES
103 | activesupport (>= 6.1.7.5, != 7.1.0)
104 | benchmark
105 | bigdecimal
106 | cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
107 | concurrent-ruby (< 1.3.4)
108 | logger
109 | mutex_m
110 | xcodeproj (< 1.26.0)
111 |
112 | RUBY VERSION
113 | ruby 2.6.10p210
114 |
115 | BUNDLED WITH
116 | 1.17.2
117 |
--------------------------------------------------------------------------------
/00-Login-Hooks/README.md:
--------------------------------------------------------------------------------
1 | # Auth0 React Native Samples - Login
2 |
3 | The complete guide to getting started with [react-native-auth0](https://github.com/auth0/react-native-auth0) is our [React Native QuickStart](https://auth0.com/docs/quickstart/native/react-native/00-login).
4 |
5 | ## 1. Install
6 |
7 | Clone the repository and install the dependencies with [Yarn](https://yarnpkg.com):
8 |
9 | ```bash
10 | git clone git@github.com:auth0-samples/auth0-react-native-sample.git
11 | cd auth0-react-native-sample/00-login-hooks
12 | yarn install
13 | ```
14 |
15 | ### iOS Applications only
16 |
17 | Change the directory into the `ios` folder and run the following command to install the SDK pod with [CocoaPods](https://cocoapods.org/):
18 |
19 | ```bash
20 | cd ios
21 | pod install
22 | ```
23 |
24 | You should see the `A0Auth0` pod being installed and linked to the sample app.
25 |
26 | ### Android applications only
27 |
28 | Open the `android/app/build.gradle` file and locate the following manifest placeholders:
29 |
30 | ```groovy
31 | android {
32 | defaultConfig {
33 | manifestPlaceholders = [auth0Domain: "YOUR_AUTH0_DOMAIN",
34 | auth0Scheme: "${applicationId}.auth0"]
35 | }
36 | ...
37 | }
38 | ```
39 |
40 | Replace `YOUR_AUTH0_DOMAIN` with your Auth0 domain value. If you have `samples.auth0.com` as your Auth0 domain you would have a configuration like the following:
41 |
42 | ```groovy
43 | android {
44 | defaultConfig {
45 | manifestPlaceholders = [auth0Domain: "samples.auth0.com",
46 | auth0Scheme: "${applicationId}.auth0"]
47 | }
48 | ...
49 | }
50 | ```
51 |
52 | The `applicationId` value will be auto-replaced at runtime with the package name or ID of your application (e.g. `com.example.app`).
53 |
54 | ## 2. Configure Auth0
55 |
56 | 1. Copy the `app/auth0-configuration.js.example` in this sample to `app/auth0-configuration.js`.
57 | 2. Open your [Applications in the Auth0 dashboard](https://manage.auth0.com/#/applications).
58 | 3. Select your existing Application from the list or click **Create Application** at the top to create a new Application of type **Native**.
59 | 4. On the **Settings** tab for the Application, copy the "Client ID" and "Domain" values and paste them into the `app/auth0-configuration.js` file created above.
60 | 5. In the **Allowed Callback URLs** field, paste in the text below and replace `YOUR_DOMAIN` with the **Domain** from above. These URLs are required for the authentication result to be redirected from the browser to the app:
61 |
62 | ```
63 | com.auth0samples.auth0://YOUR_DOMAIN/ios/com.auth0samples/callback,
64 | com.auth0samples.auth0://YOUR_DOMAIN/android/com.auth0samples/callback
65 | ```
66 |
67 | 6. Add the same values to the **Allowed Logout URLs** field as well. These are required for the browser to redirect back to the app after the user logs out.
68 | 7. Scroll down and click **Save Changes**.
69 |
70 | ## 3. Run The App
71 |
72 | Run your app on an emulator, simulator, or your own connected device.
73 |
74 | - To run the app on iOS run `yarn run ios`.
75 | - To run the app on Android run `yarn run android`.
76 |
77 | The first run may take a while to fully launch. Keep an eye out for confirmation windows and watch the terminal for output and results.
78 |
79 | **Note:** If you get an error about "No bundle URL present" try clicking reload in the app or running `yarn run ios` again.
80 |
--------------------------------------------------------------------------------
/00-Login-Hooks/__tests__/App.test.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import React from 'react';
6 | import ReactTestRenderer from 'react-test-renderer';
7 | import App from '../App';
8 |
9 | test('renders correctly', async () => {
10 | await ReactTestRenderer.act(() => {
11 | ReactTestRenderer.create();
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 | apply plugin: "org.jetbrains.kotlin.android"
3 | apply plugin: "com.facebook.react"
4 |
5 | /**
6 | * This is the configuration block to customize your React Native Android app.
7 | * By default you don't need to apply any configuration, just uncomment the lines you need.
8 | */
9 | react {
10 | /* Folders */
11 | // The root of your project, i.e. where "package.json" lives. Default is '../..'
12 | // root = file("../../")
13 | // The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14 | // reactNativeDir = file("../../node_modules/react-native")
15 | // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16 | // codegenDir = file("../../node_modules/@react-native/codegen")
17 | // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18 | // cliFile = file("../../node_modules/react-native/cli.js")
19 |
20 | /* Variants */
21 | // The list of variants to that are debuggable. For those we're going to
22 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
23 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24 | // debuggableVariants = ["liteDebug", "prodDebug"]
25 |
26 | /* Bundling */
27 | // A list containing the node command and its flags. Default is just 'node'.
28 | // nodeExecutableAndArgs = ["node"]
29 | //
30 | // The command to run when bundling. By default is 'bundle'
31 | // bundleCommand = "ram-bundle"
32 | //
33 | // The path to the CLI configuration file. Default is empty.
34 | // bundleConfig = file(../rn-cli.config.js)
35 | //
36 | // The name of the generated asset file containing your JS bundle
37 | // bundleAssetName = "MyApplication.android.bundle"
38 | //
39 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
40 | // entryFile = file("../js/MyApplication.android.js")
41 | //
42 | // A list of extra flags to pass to the 'bundle' commands.
43 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
44 | // extraPackagerArgs = []
45 |
46 | /* Hermes Commands */
47 | // The hermes compiler command to run. By default it is 'hermesc'
48 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
49 | //
50 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
51 | // hermesFlags = ["-O", "-output-source-map"]
52 |
53 | /* Autolinking */
54 | autolinkLibrariesWithApp()
55 | }
56 |
57 | /**
58 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
59 | */
60 | def enableProguardInReleaseBuilds = false
61 |
62 | /**
63 | * The preferred build flavor of JavaScriptCore (JSC)
64 | *
65 | * For example, to use the international variant, you can use:
66 | * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
67 | *
68 | * The international variant includes ICU i18n library and necessary data
69 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
70 | * give correct results when using with locales other than en-US. Note that
71 | * this variant is about 6MiB larger per architecture than default.
72 | */
73 | def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
74 |
75 | android {
76 | ndkVersion rootProject.ext.ndkVersion
77 | buildToolsVersion rootProject.ext.buildToolsVersion
78 | compileSdk rootProject.ext.compileSdkVersion
79 |
80 | namespace "com.auth0samples"
81 | defaultConfig {
82 | applicationId "com.auth0samples"
83 | manifestPlaceholders = [auth0Domain: "{DOMAIN}", auth0Scheme: "${applicationId}.auth0"]
84 | minSdkVersion rootProject.ext.minSdkVersion
85 | targetSdkVersion rootProject.ext.targetSdkVersion
86 | versionCode 1
87 | versionName "1.0"
88 | }
89 | signingConfigs {
90 | debug {
91 | storeFile file('debug.keystore')
92 | storePassword 'android'
93 | keyAlias 'androiddebugkey'
94 | keyPassword 'android'
95 | }
96 | }
97 | buildTypes {
98 | debug {
99 | signingConfig signingConfigs.debug
100 | }
101 | release {
102 | // Caution! In production, you need to generate your own keystore file.
103 | // see https://reactnative.dev/docs/signed-apk-android.
104 | signingConfig signingConfigs.debug
105 | minifyEnabled enableProguardInReleaseBuilds
106 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
107 | }
108 | }
109 | }
110 |
111 | dependencies {
112 | // The version of react-native is set by the React Native Gradle Plugin
113 | implementation("com.facebook.react:react-android")
114 |
115 | if (hermesEnabled.toBoolean()) {
116 | implementation("com.facebook.react:hermes-android")
117 | } else {
118 | implementation jscFlavor
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/debug.keystore
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/java/com/auth0samples/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.auth0samples
2 |
3 | import com.facebook.react.ReactActivity
4 | import com.facebook.react.ReactActivityDelegate
5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6 | import com.facebook.react.defaults.DefaultReactActivityDelegate
7 |
8 | class MainActivity : ReactActivity() {
9 |
10 | /**
11 | * Returns the name of the main component registered from JavaScript. This is used to schedule
12 | * rendering of the component.
13 | */
14 | override fun getMainComponentName(): String = "Auth0Sample"
15 |
16 | /**
17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19 | */
20 | override fun createReactActivityDelegate(): ReactActivityDelegate =
21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22 | }
23 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/java/com/auth0samples/MainApplication.kt:
--------------------------------------------------------------------------------
1 | package com.auth0samples
2 |
3 | import android.app.Application
4 | import com.facebook.react.PackageList
5 | import com.facebook.react.ReactApplication
6 | import com.facebook.react.ReactHost
7 | import com.facebook.react.ReactNativeHost
8 | import com.facebook.react.ReactPackage
9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11 | import com.facebook.react.defaults.DefaultReactNativeHost
12 | import com.facebook.react.soloader.OpenSourceMergedSoMapping
13 | import com.facebook.soloader.SoLoader
14 |
15 | class MainApplication : Application(), ReactApplication {
16 |
17 | override val reactNativeHost: ReactNativeHost =
18 | object : DefaultReactNativeHost(this) {
19 | override fun getPackages(): List =
20 | PackageList(this).packages.apply {
21 | // Packages that cannot be autolinked yet can be added manually here, for example:
22 | // add(MyReactNativePackage())
23 | }
24 |
25 | override fun getJSMainModuleName(): String = "index"
26 |
27 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28 |
29 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31 | }
32 |
33 | override val reactHost: ReactHost
34 | get() = getDefaultReactHost(applicationContext, reactNativeHost)
35 |
36 | override fun onCreate() {
37 | super.onCreate()
38 | SoLoader.init(this, OpenSourceMergedSoMapping)
39 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40 | // If you opted-in for the New Architecture, we load the native entry point for this app.
41 | load()
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/drawable/rn_edit_text_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
22 |
23 |
24 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Auth0Sample
3 |
4 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | buildToolsVersion = "35.0.0"
4 | minSdkVersion = 24
5 | compileSdkVersion = 35
6 | targetSdkVersion = 35
7 | ndkVersion = "27.1.12297006"
8 | kotlinVersion = "2.0.21"
9 | }
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | dependencies {
15 | classpath("com.android.tools.build:gradle")
16 | classpath("com.facebook.react:react-native-gradle-plugin")
17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
18 | }
19 | }
20 |
21 | apply plugin: "com.facebook.react.rootproject"
22 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 |
25 | # Use this property to specify which architecture you want to build.
26 | # You can also override it from the CLI using
27 | # ./gradlew -PreactNativeArchitectures=x86_64
28 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
29 |
30 | # Use this property to enable support to the new architecture.
31 | # This will allow you to use TurboModules and the Fabric render in
32 | # your application. You should enable this flag either if you want
33 | # to write custom TurboModules/Fabric components OR use libraries that
34 | # are providing them.
35 | newArchEnabled=true
36 |
37 | # Use this property to enable or disable the Hermes JS engine.
38 | # If set to false, you will be using JSC instead.
39 | hermesEnabled=true
40 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login-Hooks/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/00-Login-Hooks/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | # SPDX-License-Identifier: Apache-2.0
19 | #
20 |
21 | ##############################################################################
22 | #
23 | # Gradle start up script for POSIX generated by Gradle.
24 | #
25 | # Important for running:
26 | #
27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28 | # noncompliant, but you have some other compliant shell such as ksh or
29 | # bash, then to run this script, type that shell name before the whole
30 | # command line, like:
31 | #
32 | # ksh Gradle
33 | #
34 | # Busybox and similar reduced shells will NOT work, because this script
35 | # requires all of these POSIX shell features:
36 | # * functions;
37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39 | # * compound commands having a testable exit status, especially «case»;
40 | # * various built-in commands including «command», «set», and «ulimit».
41 | #
42 | # Important for patching:
43 | #
44 | # (2) This script targets any POSIX shell, so it avoids extensions provided
45 | # by Bash, Ksh, etc; in particular arrays are avoided.
46 | #
47 | # The "traditional" practice of packing multiple parameters into a
48 | # space-separated string is a well documented source of bugs and security
49 | # problems, so this is (mostly) avoided, by progressively accumulating
50 | # options in "$@", and eventually passing that to Java.
51 | #
52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54 | # see the in-line comments for details.
55 | #
56 | # There are tweaks for specific operating systems such as AIX, CygWin,
57 | # Darwin, MinGW, and NonStop.
58 | #
59 | # (3) This script is generated from the Groovy template
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61 | # within the Gradle project.
62 | #
63 | # You can find Gradle at https://github.com/gradle/gradle/.
64 | #
65 | ##############################################################################
66 |
67 | # Attempt to set APP_HOME
68 |
69 | # Resolve links: $0 may be a link
70 | app_path=$0
71 |
72 | # Need this for daisy-chained symlinks.
73 | while
74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75 | [ -h "$app_path" ]
76 | do
77 | ls=$( ls -ld "$app_path" )
78 | link=${ls#*' -> '}
79 | case $link in #(
80 | /*) app_path=$link ;; #(
81 | *) app_path=$APP_HOME$link ;;
82 | esac
83 | done
84 |
85 | # This is normally unused
86 | # shellcheck disable=SC2034
87 | APP_BASE_NAME=${0##*/}
88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | if ! command -v java >/dev/null 2>&1
137 | then
138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
139 |
140 | Please set the JAVA_HOME variable in your environment to match the
141 | location of your Java installation."
142 | fi
143 | fi
144 |
145 | # Increase the maximum file descriptors if we can.
146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
147 | case $MAX_FD in #(
148 | max*)
149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
150 | # shellcheck disable=SC2039,SC3045
151 | MAX_FD=$( ulimit -H -n ) ||
152 | warn "Could not query maximum file descriptor limit"
153 | esac
154 | case $MAX_FD in #(
155 | '' | soft) :;; #(
156 | *)
157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
158 | # shellcheck disable=SC2039,SC3045
159 | ulimit -n "$MAX_FD" ||
160 | warn "Could not set maximum file descriptor limit to $MAX_FD"
161 | esac
162 | fi
163 |
164 | # Collect all arguments for the java command, stacking in reverse order:
165 | # * args from the command line
166 | # * the main class name
167 | # * -classpath
168 | # * -D...appname settings
169 | # * --module-path (only if needed)
170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
171 |
172 | # For Cygwin or MSYS, switch paths to Windows format before running java
173 | if "$cygwin" || "$msys" ; then
174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176 |
177 | JAVACMD=$( cygpath --unix "$JAVACMD" )
178 |
179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
180 | for arg do
181 | if
182 | case $arg in #(
183 | -*) false ;; # don't mess with options #(
184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
185 | [ -e "$t" ] ;; #(
186 | *) false ;;
187 | esac
188 | then
189 | arg=$( cygpath --path --ignore --mixed "$arg" )
190 | fi
191 | # Roll the args list around exactly as many times as the number of
192 | # args, so each arg winds up back in the position where it started, but
193 | # possibly modified.
194 | #
195 | # NB: a `for` loop captures its iteration list before it begins, so
196 | # changing the positional parameters here affects neither the number of
197 | # iterations, nor the values presented in `arg`.
198 | shift # remove old arg
199 | set -- "$@" "$arg" # push replacement arg
200 | done
201 | fi
202 |
203 |
204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206 |
207 | # Collect all arguments for the java command:
208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209 | # and any embedded shellness will be escaped.
210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211 | # treated as '${Hostname}' itself on the command line.
212 |
213 | set -- \
214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
215 | -classpath "$CLASSPATH" \
216 | org.gradle.wrapper.GradleWrapperMain \
217 | "$@"
218 |
219 | # Stop when "xargs" is not available.
220 | if ! command -v xargs >/dev/null 2>&1
221 | then
222 | die "xargs is not available"
223 | fi
224 |
225 | # Use "xargs" to parse quoted args.
226 | #
227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
228 | #
229 | # In Bash we could simply go:
230 | #
231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
232 | # set -- "${ARGS[@]}" "$@"
233 | #
234 | # but POSIX shell has neither arrays nor command substitution, so instead we
235 | # post-process each arg (as a line of input to sed) to backslash-escape any
236 | # character that might be a shell metacharacter, then use eval to reverse
237 | # that process (while maintaining the separation between arguments), and wrap
238 | # the whole thing up as a single "set" statement.
239 | #
240 | # This will of course break if any of these variables contains a newline or
241 | # an unmatched quote.
242 | #
243 |
244 | eval "set -- $(
245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
246 | xargs -n1 |
247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
248 | tr '\n' ' '
249 | )" '"$@"'
250 |
251 | exec "$JAVACMD" "$@"
252 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
74 |
75 |
76 | @rem Execute Gradle
77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
78 |
79 | :end
80 | @rem End local scope for the variables with windows NT shell
81 | if %ERRORLEVEL% equ 0 goto mainEnd
82 |
83 | :fail
84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85 | rem the _cmd.exe /c_ return code!
86 | set EXIT_CODE=%ERRORLEVEL%
87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89 | exit /b %EXIT_CODE%
90 |
91 | :mainEnd
92 | if "%OS%"=="Windows_NT" endlocal
93 |
94 | :omega
95 |
--------------------------------------------------------------------------------
/00-Login-Hooks/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2 | plugins { id("com.facebook.react.settings") }
3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
4 | rootProject.name = "Auth0Sample"
5 | include ':app'
6 | includeBuild('../node_modules/@react-native/gradle-plugin')
7 |
--------------------------------------------------------------------------------
/00-Login-Hooks/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Auth0Sample",
3 | "displayName": "Auth0Sample"
4 | }
5 |
--------------------------------------------------------------------------------
/00-Login-Hooks/auth0-configuration.js.example:
--------------------------------------------------------------------------------
1 | const config = {
2 | clientId: "{CLIENT_ID}",
3 | domain: "{DOMAIN}"
4 | };
5 |
6 | export default config;
--------------------------------------------------------------------------------
/00-Login-Hooks/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:@react-native/babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/00-Login-Hooks/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import {AppRegistry} from 'react-native';
6 | import App from './App';
7 | import {name as appName} from './app.json';
8 |
9 | AppRegistry.registerComponent(appName, () => App);
10 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/.xcode.env:
--------------------------------------------------------------------------------
1 | # This `.xcode.env` file is versioned and is used to source the environment
2 | # used when running script phases inside Xcode.
3 | # To customize your local environment, you can create an `.xcode.env.local`
4 | # file that is not versioned.
5 |
6 | # NODE_BINARY variable contains the PATH to the node executable.
7 | #
8 | # Customize the NODE_BINARY variable here.
9 | # For example, to use nvm with brew, add the following line
10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use
11 | export NODE_BINARY=$(command -v node)
12 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0C80B921A6F3F58F76C31292 /* libPods-Auth0Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-Auth0Sample.a */; };
11 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
12 | 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
13 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
14 | C49D226ACE8E41B78B1F1650 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXFileReference section */
18 | 13B07F961A680F5B00A75B9A /* Auth0Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Auth0Sample.app; sourceTree = BUILT_PRODUCTS_DIR; };
19 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Auth0Sample/Images.xcassets; sourceTree = ""; };
20 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Auth0Sample/Info.plist; sourceTree = ""; };
21 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = Auth0Sample/PrivacyInfo.xcprivacy; sourceTree = ""; };
22 | 3B4392A12AC88292D35C810B /* Pods-Auth0Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Auth0Sample.debug.xcconfig"; path = "Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample.debug.xcconfig"; sourceTree = ""; };
23 | 5709B34CF0A7D63546082F79 /* Pods-Auth0Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Auth0Sample.release.xcconfig"; path = "Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample.release.xcconfig"; sourceTree = ""; };
24 | 5DCACB8F33CDC322A6C60F78 /* libPods-Auth0Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Auth0Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
25 | 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Auth0Sample/AppDelegate.swift; sourceTree = ""; };
26 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Auth0Sample/LaunchScreen.storyboard; sourceTree = ""; };
27 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
28 | /* End PBXFileReference section */
29 |
30 | /* Begin PBXFrameworksBuildPhase section */
31 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
32 | isa = PBXFrameworksBuildPhase;
33 | buildActionMask = 2147483647;
34 | files = (
35 | 0C80B921A6F3F58F76C31292 /* libPods-Auth0Sample.a in Frameworks */,
36 | );
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXFrameworksBuildPhase section */
40 |
41 | /* Begin PBXGroup section */
42 | 13B07FAE1A68108700A75B9A /* Auth0Sample */ = {
43 | isa = PBXGroup;
44 | children = (
45 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
46 | 761780EC2CA45674006654EE /* AppDelegate.swift */,
47 | 13B07FB61A68108700A75B9A /* Info.plist */,
48 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
49 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
50 | );
51 | name = Auth0Sample;
52 | sourceTree = "";
53 | };
54 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
55 | isa = PBXGroup;
56 | children = (
57 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
58 | 5DCACB8F33CDC322A6C60F78 /* libPods-Auth0Sample.a */,
59 | );
60 | name = Frameworks;
61 | sourceTree = "";
62 | };
63 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
64 | isa = PBXGroup;
65 | children = (
66 | );
67 | name = Libraries;
68 | sourceTree = "";
69 | };
70 | 83CBB9F61A601CBA00E9B192 = {
71 | isa = PBXGroup;
72 | children = (
73 | 13B07FAE1A68108700A75B9A /* Auth0Sample */,
74 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
75 | 83CBBA001A601CBA00E9B192 /* Products */,
76 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
77 | BBD78D7AC51CEA395F1C20DB /* Pods */,
78 | );
79 | indentWidth = 2;
80 | sourceTree = "";
81 | tabWidth = 2;
82 | usesTabs = 0;
83 | };
84 | 83CBBA001A601CBA00E9B192 /* Products */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 13B07F961A680F5B00A75B9A /* Auth0Sample.app */,
88 | );
89 | name = Products;
90 | sourceTree = "";
91 | };
92 | BBD78D7AC51CEA395F1C20DB /* Pods */ = {
93 | isa = PBXGroup;
94 | children = (
95 | 3B4392A12AC88292D35C810B /* Pods-Auth0Sample.debug.xcconfig */,
96 | 5709B34CF0A7D63546082F79 /* Pods-Auth0Sample.release.xcconfig */,
97 | );
98 | path = Pods;
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 13B07F861A680F5B00A75B9A /* Auth0Sample */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Auth0Sample" */;
107 | buildPhases = (
108 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
109 | 13B07F871A680F5B00A75B9A /* Sources */,
110 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
111 | 13B07F8E1A680F5B00A75B9A /* Resources */,
112 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
113 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
114 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
115 | );
116 | buildRules = (
117 | );
118 | dependencies = (
119 | );
120 | name = Auth0Sample;
121 | productName = Auth0Sample;
122 | productReference = 13B07F961A680F5B00A75B9A /* Auth0Sample.app */;
123 | productType = "com.apple.product-type.application";
124 | };
125 | /* End PBXNativeTarget section */
126 |
127 | /* Begin PBXProject section */
128 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
129 | isa = PBXProject;
130 | attributes = {
131 | LastUpgradeCheck = 1210;
132 | TargetAttributes = {
133 | 13B07F861A680F5B00A75B9A = {
134 | LastSwiftMigration = 1120;
135 | };
136 | };
137 | };
138 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Auth0Sample" */;
139 | compatibilityVersion = "Xcode 12.0";
140 | developmentRegion = en;
141 | hasScannedForEncodings = 0;
142 | knownRegions = (
143 | en,
144 | Base,
145 | );
146 | mainGroup = 83CBB9F61A601CBA00E9B192;
147 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
148 | projectDirPath = "";
149 | projectRoot = "";
150 | targets = (
151 | 13B07F861A680F5B00A75B9A /* Auth0Sample */,
152 | );
153 | };
154 | /* End PBXProject section */
155 |
156 | /* Begin PBXResourcesBuildPhase section */
157 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
158 | isa = PBXResourcesBuildPhase;
159 | buildActionMask = 2147483647;
160 | files = (
161 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
162 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
163 | C49D226ACE8E41B78B1F1650 /* PrivacyInfo.xcprivacy in Resources */,
164 | );
165 | runOnlyForDeploymentPostprocessing = 0;
166 | };
167 | /* End PBXResourcesBuildPhase section */
168 |
169 | /* Begin PBXShellScriptBuildPhase section */
170 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
171 | isa = PBXShellScriptBuildPhase;
172 | buildActionMask = 2147483647;
173 | files = (
174 | );
175 | inputPaths = (
176 | "$(SRCROOT)/.xcode.env.local",
177 | "$(SRCROOT)/.xcode.env",
178 | );
179 | name = "Bundle React Native code and images";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
185 | };
186 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputFileListPaths = (
192 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
193 | );
194 | name = "[CP] Embed Pods Frameworks";
195 | outputFileListPaths = (
196 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
197 | );
198 | runOnlyForDeploymentPostprocessing = 0;
199 | shellPath = /bin/sh;
200 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-frameworks.sh\"\n";
201 | showEnvVarsInLog = 0;
202 | };
203 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
204 | isa = PBXShellScriptBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | );
208 | inputFileListPaths = (
209 | );
210 | inputPaths = (
211 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
212 | "${PODS_ROOT}/Manifest.lock",
213 | );
214 | name = "[CP] Check Pods Manifest.lock";
215 | outputFileListPaths = (
216 | );
217 | outputPaths = (
218 | "$(DERIVED_FILE_DIR)/Pods-Auth0Sample-checkManifestLockResult.txt",
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | shellPath = /bin/sh;
222 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
223 | showEnvVarsInLog = 0;
224 | };
225 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
226 | isa = PBXShellScriptBuildPhase;
227 | buildActionMask = 2147483647;
228 | files = (
229 | );
230 | inputFileListPaths = (
231 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-resources-${CONFIGURATION}-input-files.xcfilelist",
232 | );
233 | name = "[CP] Copy Pods Resources";
234 | outputFileListPaths = (
235 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-resources-${CONFIGURATION}-output-files.xcfilelist",
236 | );
237 | runOnlyForDeploymentPostprocessing = 0;
238 | shellPath = /bin/sh;
239 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-resources.sh\"\n";
240 | showEnvVarsInLog = 0;
241 | };
242 | /* End PBXShellScriptBuildPhase section */
243 |
244 | /* Begin PBXSourcesBuildPhase section */
245 | 13B07F871A680F5B00A75B9A /* Sources */ = {
246 | isa = PBXSourcesBuildPhase;
247 | buildActionMask = 2147483647;
248 | files = (
249 | 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */,
250 | );
251 | runOnlyForDeploymentPostprocessing = 0;
252 | };
253 | /* End PBXSourcesBuildPhase section */
254 |
255 | /* Begin XCBuildConfiguration section */
256 | 13B07F941A680F5B00A75B9A /* Debug */ = {
257 | isa = XCBuildConfiguration;
258 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-Auth0Sample.debug.xcconfig */;
259 | buildSettings = {
260 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
261 | CLANG_ENABLE_MODULES = YES;
262 | CURRENT_PROJECT_VERSION = 1;
263 | ENABLE_BITCODE = NO;
264 | INFOPLIST_FILE = Auth0Sample/Info.plist;
265 | INFOPLIST_KEY_CFBundleDisplayName = Auth0Sample;
266 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
267 | LD_RUNPATH_SEARCH_PATHS = (
268 | "$(inherited)",
269 | "@executable_path/Frameworks",
270 | );
271 | MARKETING_VERSION = 1.0;
272 | OTHER_LDFLAGS = (
273 | "$(inherited)",
274 | "-ObjC",
275 | "-lc++",
276 | );
277 | PRODUCT_BUNDLE_IDENTIFIER = com.auth0samples;
278 | PRODUCT_NAME = Auth0Sample;
279 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
280 | SWIFT_VERSION = 5.0;
281 | VERSIONING_SYSTEM = "apple-generic";
282 | };
283 | name = Debug;
284 | };
285 | 13B07F951A680F5B00A75B9A /* Release */ = {
286 | isa = XCBuildConfiguration;
287 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-Auth0Sample.release.xcconfig */;
288 | buildSettings = {
289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
290 | CLANG_ENABLE_MODULES = YES;
291 | CURRENT_PROJECT_VERSION = 1;
292 | INFOPLIST_FILE = Auth0Sample/Info.plist;
293 | INFOPLIST_KEY_CFBundleDisplayName = Auth0Sample;
294 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
295 | LD_RUNPATH_SEARCH_PATHS = (
296 | "$(inherited)",
297 | "@executable_path/Frameworks",
298 | );
299 | MARKETING_VERSION = 1.0;
300 | OTHER_LDFLAGS = (
301 | "$(inherited)",
302 | "-ObjC",
303 | "-lc++",
304 | );
305 | PRODUCT_BUNDLE_IDENTIFIER = com.auth0samples;
306 | PRODUCT_NAME = Auth0Sample;
307 | SWIFT_VERSION = 5.0;
308 | VERSIONING_SYSTEM = "apple-generic";
309 | };
310 | name = Release;
311 | };
312 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
313 | isa = XCBuildConfiguration;
314 | buildSettings = {
315 | ALWAYS_SEARCH_USER_PATHS = NO;
316 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
317 | CLANG_CXX_LANGUAGE_STANDARD = "c++20";
318 | CLANG_CXX_LIBRARY = "libc++";
319 | CLANG_ENABLE_MODULES = YES;
320 | CLANG_ENABLE_OBJC_ARC = YES;
321 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
322 | CLANG_WARN_BOOL_CONVERSION = YES;
323 | CLANG_WARN_COMMA = YES;
324 | CLANG_WARN_CONSTANT_CONVERSION = YES;
325 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
326 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
327 | CLANG_WARN_EMPTY_BODY = YES;
328 | CLANG_WARN_ENUM_CONVERSION = YES;
329 | CLANG_WARN_INFINITE_RECURSION = YES;
330 | CLANG_WARN_INT_CONVERSION = YES;
331 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
332 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
333 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
334 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
335 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
336 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
337 | CLANG_WARN_STRICT_PROTOTYPES = YES;
338 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
339 | CLANG_WARN_UNREACHABLE_CODE = YES;
340 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
341 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
342 | COPY_PHASE_STRIP = NO;
343 | ENABLE_STRICT_OBJC_MSGSEND = YES;
344 | ENABLE_TESTABILITY = YES;
345 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
346 | GCC_C_LANGUAGE_STANDARD = gnu99;
347 | GCC_DYNAMIC_NO_PIC = NO;
348 | GCC_NO_COMMON_BLOCKS = YES;
349 | GCC_OPTIMIZATION_LEVEL = 0;
350 | GCC_PREPROCESSOR_DEFINITIONS = (
351 | "DEBUG=1",
352 | "$(inherited)",
353 | );
354 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
355 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
356 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
357 | GCC_WARN_UNDECLARED_SELECTOR = YES;
358 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
359 | GCC_WARN_UNUSED_FUNCTION = YES;
360 | GCC_WARN_UNUSED_VARIABLE = YES;
361 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
362 | LD_RUNPATH_SEARCH_PATHS = (
363 | /usr/lib/swift,
364 | "$(inherited)",
365 | );
366 | LIBRARY_SEARCH_PATHS = (
367 | "\"$(SDKROOT)/usr/lib/swift\"",
368 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
369 | "\"$(inherited)\"",
370 | );
371 | MTL_ENABLE_DEBUG_INFO = YES;
372 | ONLY_ACTIVE_ARCH = YES;
373 | OTHER_CPLUSPLUSFLAGS = (
374 | "$(OTHER_CFLAGS)",
375 | "-DFOLLY_NO_CONFIG",
376 | "-DFOLLY_MOBILE=1",
377 | "-DFOLLY_USE_LIBCPP=1",
378 | "-DFOLLY_CFG_NO_COROUTINES=1",
379 | "-DFOLLY_HAVE_CLOCK_GETTIME=1",
380 | );
381 | OTHER_LDFLAGS = (
382 | "$(inherited)",
383 | " ",
384 | );
385 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
386 | SDKROOT = iphoneos;
387 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
388 | USE_HERMES = true;
389 | };
390 | name = Debug;
391 | };
392 | 83CBBA211A601CBA00E9B192 /* Release */ = {
393 | isa = XCBuildConfiguration;
394 | buildSettings = {
395 | ALWAYS_SEARCH_USER_PATHS = NO;
396 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
397 | CLANG_CXX_LANGUAGE_STANDARD = "c++20";
398 | CLANG_CXX_LIBRARY = "libc++";
399 | CLANG_ENABLE_MODULES = YES;
400 | CLANG_ENABLE_OBJC_ARC = YES;
401 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
402 | CLANG_WARN_BOOL_CONVERSION = YES;
403 | CLANG_WARN_COMMA = YES;
404 | CLANG_WARN_CONSTANT_CONVERSION = YES;
405 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
406 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
407 | CLANG_WARN_EMPTY_BODY = YES;
408 | CLANG_WARN_ENUM_CONVERSION = YES;
409 | CLANG_WARN_INFINITE_RECURSION = YES;
410 | CLANG_WARN_INT_CONVERSION = YES;
411 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
412 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
413 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
414 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
415 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
416 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
417 | CLANG_WARN_STRICT_PROTOTYPES = YES;
418 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
419 | CLANG_WARN_UNREACHABLE_CODE = YES;
420 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
421 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
422 | COPY_PHASE_STRIP = YES;
423 | ENABLE_NS_ASSERTIONS = NO;
424 | ENABLE_STRICT_OBJC_MSGSEND = YES;
425 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
426 | GCC_C_LANGUAGE_STANDARD = gnu99;
427 | GCC_NO_COMMON_BLOCKS = YES;
428 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
429 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
430 | GCC_WARN_UNDECLARED_SELECTOR = YES;
431 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
432 | GCC_WARN_UNUSED_FUNCTION = YES;
433 | GCC_WARN_UNUSED_VARIABLE = YES;
434 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
435 | LD_RUNPATH_SEARCH_PATHS = (
436 | /usr/lib/swift,
437 | "$(inherited)",
438 | );
439 | LIBRARY_SEARCH_PATHS = (
440 | "\"$(SDKROOT)/usr/lib/swift\"",
441 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
442 | "\"$(inherited)\"",
443 | );
444 | MTL_ENABLE_DEBUG_INFO = NO;
445 | OTHER_CPLUSPLUSFLAGS = (
446 | "$(OTHER_CFLAGS)",
447 | "-DFOLLY_NO_CONFIG",
448 | "-DFOLLY_MOBILE=1",
449 | "-DFOLLY_USE_LIBCPP=1",
450 | "-DFOLLY_CFG_NO_COROUTINES=1",
451 | "-DFOLLY_HAVE_CLOCK_GETTIME=1",
452 | );
453 | OTHER_LDFLAGS = (
454 | "$(inherited)",
455 | " ",
456 | );
457 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
458 | SDKROOT = iphoneos;
459 | USE_HERMES = true;
460 | VALIDATE_PRODUCT = YES;
461 | };
462 | name = Release;
463 | };
464 | /* End XCBuildConfiguration section */
465 |
466 | /* Begin XCConfigurationList section */
467 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Auth0Sample" */ = {
468 | isa = XCConfigurationList;
469 | buildConfigurations = (
470 | 13B07F941A680F5B00A75B9A /* Debug */,
471 | 13B07F951A680F5B00A75B9A /* Release */,
472 | );
473 | defaultConfigurationIsVisible = 0;
474 | defaultConfigurationName = Release;
475 | };
476 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Auth0Sample" */ = {
477 | isa = XCConfigurationList;
478 | buildConfigurations = (
479 | 83CBBA201A601CBA00E9B192 /* Debug */,
480 | 83CBBA211A601CBA00E9B192 /* Release */,
481 | );
482 | defaultConfigurationIsVisible = 0;
483 | defaultConfigurationName = Release;
484 | };
485 | /* End XCConfigurationList section */
486 | };
487 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
488 | }
489 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample.xcodeproj/xcshareddata/xcschemes/Auth0Sample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import React
3 | import React_RCTAppDelegate
4 | import ReactAppDependencyProvider
5 |
6 | @main
7 | class AppDelegate: UIResponder, UIApplicationDelegate {
8 | var window: UIWindow?
9 |
10 | var reactNativeDelegate: ReactNativeDelegate?
11 | var reactNativeFactory: RCTReactNativeFactory?
12 |
13 | func application(
14 | _ application: UIApplication,
15 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
16 | ) -> Bool {
17 | let delegate = ReactNativeDelegate()
18 | let factory = RCTReactNativeFactory(delegate: delegate)
19 | delegate.dependencyProvider = RCTAppDependencyProvider()
20 |
21 | reactNativeDelegate = delegate
22 | reactNativeFactory = factory
23 |
24 | window = UIWindow(frame: UIScreen.main.bounds)
25 |
26 | factory.startReactNative(
27 | withModuleName: "Auth0Sample",
28 | in: window,
29 | launchOptions: launchOptions
30 | )
31 |
32 | return true
33 | }
34 |
35 | func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
36 | return RCTLinkingManager.application(app, open: url, options: options)
37 | }
38 | }
39 |
40 | class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
41 | override func sourceURL(for bridge: RCTBridge) -> URL? {
42 | self.bundleURL()
43 | }
44 |
45 | override func bundleURL() -> URL? {
46 | #if DEBUG
47 | RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
48 | #else
49 | Bundle.main.url(forResource: "main", withExtension: "jsbundle")
50 | #endif
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "scale" : "1x",
46 | "size" : "1024x1024"
47 | }
48 | ],
49 | "info" : {
50 | "author" : "xcode",
51 | "version" : 1
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Auth0Sample
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleURLTypes
14 |
15 |
16 | CFBundleTypeRole
17 | None
18 | CFBundleURLName
19 | auth0
20 | CFBundleURLSchemes
21 |
22 | $(PRODUCT_BUNDLE_IDENTIFIER).auth0
23 |
24 |
25 |
26 | CFBundleInfoDictionaryVersion
27 | 6.0
28 | CFBundleName
29 | $(PRODUCT_NAME)
30 | CFBundlePackageType
31 | APPL
32 | CFBundleShortVersionString
33 | $(MARKETING_VERSION)
34 | CFBundleSignature
35 | ????
36 | CFBundleVersion
37 | $(CURRENT_PROJECT_VERSION)
38 | LSRequiresIPhoneOS
39 |
40 | NSAppTransportSecurity
41 |
42 | NSAllowsArbitraryLoads
43 |
44 | NSAllowsLocalNetworking
45 |
46 |
47 | NSLocationWhenInUseUsageDescription
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | UIRequiredDeviceCapabilities
52 |
53 | arm64
54 |
55 | UISupportedInterfaceOrientations
56 |
57 | UIInterfaceOrientationPortrait
58 | UIInterfaceOrientationLandscapeLeft
59 | UIInterfaceOrientationLandscapeRight
60 |
61 | UIViewControllerBasedStatusBarAppearance
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Auth0Sample/PrivacyInfo.xcprivacy:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSPrivacyAccessedAPITypes
6 |
7 |
8 | NSPrivacyAccessedAPIType
9 | NSPrivacyAccessedAPICategoryFileTimestamp
10 | NSPrivacyAccessedAPITypeReasons
11 |
12 | C617.1
13 |
14 |
15 |
16 | NSPrivacyAccessedAPIType
17 | NSPrivacyAccessedAPICategoryUserDefaults
18 | NSPrivacyAccessedAPITypeReasons
19 |
20 | CA92.1
21 |
22 |
23 |
24 | NSPrivacyAccessedAPIType
25 | NSPrivacyAccessedAPICategorySystemBootTime
26 | NSPrivacyAccessedAPITypeReasons
27 |
28 | 35F9.1
29 |
30 |
31 |
32 | NSPrivacyCollectedDataTypes
33 |
34 | NSPrivacyTracking
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/00-Login-Hooks/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Resolve react_native_pods.rb with node to allow for hoisting
2 | require Pod::Executable.execute_command('node', ['-p',
3 | 'require.resolve(
4 | "react-native/scripts/react_native_pods.rb",
5 | {paths: [process.argv[1]]},
6 | )', __dir__]).strip
7 |
8 | platform :ios, min_ios_version_supported
9 | prepare_react_native_project!
10 |
11 | linkage = ENV['USE_FRAMEWORKS']
12 | if linkage != nil
13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
14 | use_frameworks! :linkage => linkage.to_sym
15 | end
16 |
17 | target 'Auth0Sample' do
18 | config = use_native_modules!
19 |
20 | use_react_native!(
21 | :path => config[:reactNativePath],
22 | # An absolute path to your application root.
23 | :app_path => "#{Pod::Config.instance.installation_root}/.."
24 | )
25 |
26 | post_install do |installer|
27 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
28 | react_native_post_install(
29 | installer,
30 | config[:reactNativePath],
31 | :mac_catalyst_enabled => false,
32 | # :ccache_enabled => true
33 | )
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/00-Login-Hooks/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | preset: 'react-native',
3 | };
4 |
--------------------------------------------------------------------------------
/00-Login-Hooks/metro.config.js:
--------------------------------------------------------------------------------
1 | const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
2 |
3 | /**
4 | * Metro configuration
5 | * https://reactnative.dev/docs/metro
6 | *
7 | * @type {import('@react-native/metro-config').MetroConfig}
8 | */
9 | const config = {};
10 |
11 | module.exports = mergeConfig(getDefaultConfig(__dirname), config);
12 |
--------------------------------------------------------------------------------
/00-Login-Hooks/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "auth0sample",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "lint": "eslint .",
9 | "start": "react-native start",
10 | "test": "jest"
11 | },
12 | "dependencies": {
13 | "react": "19.0.0",
14 | "react-native": "0.79.2",
15 | "react-native-auth0": "^5.0.0-beta.1"
16 | },
17 | "devDependencies": {
18 | "@babel/core": "^7.25.2",
19 | "@babel/preset-env": "^7.25.3",
20 | "@babel/runtime": "^7.25.0",
21 | "@react-native-community/cli": "18.0.0",
22 | "@react-native-community/cli-platform-android": "18.0.0",
23 | "@react-native-community/cli-platform-ios": "18.0.0",
24 | "@react-native/babel-preset": "0.79.2",
25 | "@react-native/eslint-config": "0.79.2",
26 | "@react-native/metro-config": "0.79.2",
27 | "@react-native/typescript-config": "0.79.2",
28 | "@types/jest": "^29.5.13",
29 | "@types/react": "^19.0.0",
30 | "@types/react-test-renderer": "^19.0.0",
31 | "eslint": "^8.19.0",
32 | "jest": "^29.6.3",
33 | "prettier": "2.8.8",
34 | "react-test-renderer": "19.0.0",
35 | "typescript": "5.0.4"
36 | },
37 | "engines": {
38 | "node": ">=18"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/00-Login-Hooks/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@react-native/typescript-config/tsconfig.json"
3 | }
4 |
--------------------------------------------------------------------------------
/00-Login/.bundle/config:
--------------------------------------------------------------------------------
1 | BUNDLE_PATH: "vendor/bundle"
2 | BUNDLE_FORCE_RUBY_PLATFORM: 1
3 |
--------------------------------------------------------------------------------
/00-Login/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: '@react-native',
4 | };
5 |
--------------------------------------------------------------------------------
/00-Login/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | **/.xcode.env.local
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 | *.hprof
33 | .cxx/
34 | *.keystore
35 | !debug.keystore
36 | .kotlin/
37 |
38 | # node.js
39 | #
40 | node_modules/
41 | npm-debug.log
42 | yarn-error.log
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | **/fastlane/report.xml
52 | **/fastlane/Preview.html
53 | **/fastlane/screenshots
54 | **/fastlane/test_output
55 |
56 | # Bundle artifact
57 | *.jsbundle
58 |
59 | # Ruby / CocoaPods
60 | **/Pods/
61 | /vendor/bundle/
62 |
63 | # Temporary files created by Metro to check the health of the file watcher
64 | .metro-health-check*
65 |
66 | # testing
67 | /coverage
68 |
69 | # Yarn
70 | .yarn/*
71 | !.yarn/patches
72 | !.yarn/plugins
73 | !.yarn/releases
74 | !.yarn/sdks
75 | !.yarn/versions
76 |
--------------------------------------------------------------------------------
/00-Login/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | arrowParens: 'avoid',
3 | bracketSameLine: true,
4 | bracketSpacing: false,
5 | singleQuote: true,
6 | trailingComma: 'all',
7 | };
8 |
--------------------------------------------------------------------------------
/00-Login/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/00-Login/App.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | * @flow strict-local
7 | */
8 |
9 | import React, { useState } from 'react';
10 | import {
11 | Alert,
12 | Button,
13 | StyleSheet,
14 | Text,
15 | View
16 | } from 'react-native';
17 | import Auth0 from 'react-native-auth0';
18 |
19 | import config from './auth0-configuration';
20 | const auth0 = new Auth0(config);
21 |
22 | const App = () => {
23 |
24 | let [accessToken, setAccessToken] = useState(null);
25 |
26 | const onLogin = () => {
27 | auth0.webAuth
28 | .authorize()
29 | .then(credentials => {
30 | Alert.alert('AccessToken: ' + credentials.accessToken);
31 | setAccessToken(credentials.accessToken);
32 | })
33 | .catch(error => console.log(error));
34 | };
35 |
36 | const onLogout = () => {
37 | auth0.webAuth
38 | .clearSession({})
39 | .then(() => {
40 | Alert.alert('Logged out!');
41 | setAccessToken(null);
42 | })
43 | .catch(() => {
44 | console.log('Log out cancelled');
45 | });
46 | };
47 |
48 | let loggedIn = accessToken !== null;
49 | return (
50 |
51 | Auth0Sample - Login
52 | You are{loggedIn ? ' ' : ' not '}logged in.
53 |
55 |
56 | );
57 | }
58 |
59 | const styles = StyleSheet.create({
60 | container: {
61 | flex: 1,
62 | justifyContent: 'center',
63 | alignItems: 'center',
64 | backgroundColor: '#F5FCFF'
65 | },
66 | header: {
67 | fontSize: 20,
68 | textAlign: 'center',
69 | margin: 10
70 | }
71 | });
72 |
73 | export default App;
--------------------------------------------------------------------------------
/00-Login/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4 | ruby ">= 2.6.10"
5 |
6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures.
7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9 | gem 'xcodeproj', '< 1.26.0'
10 | gem 'concurrent-ruby', '< 1.3.4'
11 |
12 | # Ruby 3.4.0 has removed some libraries from the standard library.
13 | gem 'bigdecimal'
14 | gem 'logger'
15 | gem 'benchmark'
16 | gem 'mutex_m'
17 |
--------------------------------------------------------------------------------
/00-Login/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.7)
5 | base64
6 | nkf
7 | rexml
8 | activesupport (6.1.7.10)
9 | concurrent-ruby (~> 1.0, >= 1.0.2)
10 | i18n (>= 1.6, < 2)
11 | minitest (>= 5.1)
12 | tzinfo (~> 2.0)
13 | zeitwerk (~> 2.3)
14 | addressable (2.8.7)
15 | public_suffix (>= 2.0.2, < 7.0)
16 | algoliasearch (1.27.5)
17 | httpclient (~> 2.8, >= 2.8.3)
18 | json (>= 1.5.1)
19 | atomos (0.1.3)
20 | base64 (0.2.0)
21 | benchmark (0.4.0)
22 | bigdecimal (3.1.9)
23 | claide (1.1.0)
24 | cocoapods (1.15.2)
25 | addressable (~> 2.8)
26 | claide (>= 1.0.2, < 2.0)
27 | cocoapods-core (= 1.15.2)
28 | cocoapods-deintegrate (>= 1.0.3, < 2.0)
29 | cocoapods-downloader (>= 2.1, < 3.0)
30 | cocoapods-plugins (>= 1.0.0, < 2.0)
31 | cocoapods-search (>= 1.0.0, < 2.0)
32 | cocoapods-trunk (>= 1.6.0, < 2.0)
33 | cocoapods-try (>= 1.1.0, < 2.0)
34 | colored2 (~> 3.1)
35 | escape (~> 0.0.4)
36 | fourflusher (>= 2.3.0, < 3.0)
37 | gh_inspector (~> 1.0)
38 | molinillo (~> 0.8.0)
39 | nap (~> 1.0)
40 | ruby-macho (>= 2.3.0, < 3.0)
41 | xcodeproj (>= 1.23.0, < 2.0)
42 | cocoapods-core (1.15.2)
43 | activesupport (>= 5.0, < 8)
44 | addressable (~> 2.8)
45 | algoliasearch (~> 1.0)
46 | concurrent-ruby (~> 1.1)
47 | fuzzy_match (~> 2.0.4)
48 | nap (~> 1.0)
49 | netrc (~> 0.11)
50 | public_suffix (~> 4.0)
51 | typhoeus (~> 1.0)
52 | cocoapods-deintegrate (1.0.5)
53 | cocoapods-downloader (2.1)
54 | cocoapods-plugins (1.0.0)
55 | nap
56 | cocoapods-search (1.0.1)
57 | cocoapods-trunk (1.6.0)
58 | nap (>= 0.8, < 2.0)
59 | netrc (~> 0.11)
60 | cocoapods-try (1.2.0)
61 | colored2 (3.1.2)
62 | concurrent-ruby (1.3.3)
63 | escape (0.0.4)
64 | ethon (0.16.0)
65 | ffi (>= 1.15.0)
66 | ffi (1.17.2)
67 | fourflusher (2.3.1)
68 | fuzzy_match (2.0.4)
69 | gh_inspector (1.1.3)
70 | httpclient (2.9.0)
71 | mutex_m
72 | i18n (1.14.7)
73 | concurrent-ruby (~> 1.0)
74 | json (2.7.6)
75 | logger (1.7.0)
76 | minitest (5.25.4)
77 | molinillo (0.8.0)
78 | mutex_m (0.3.0)
79 | nanaimo (0.3.0)
80 | nap (1.1.0)
81 | netrc (0.11.0)
82 | nkf (0.2.0)
83 | public_suffix (4.0.7)
84 | rexml (3.4.1)
85 | ruby-macho (2.5.1)
86 | typhoeus (1.4.1)
87 | ethon (>= 0.9.0)
88 | tzinfo (2.0.6)
89 | concurrent-ruby (~> 1.0)
90 | xcodeproj (1.25.1)
91 | CFPropertyList (>= 2.3.3, < 4.0)
92 | atomos (~> 0.1.3)
93 | claide (>= 1.0.2, < 2.0)
94 | colored2 (~> 3.1)
95 | nanaimo (~> 0.3.0)
96 | rexml (>= 3.3.6, < 4.0)
97 | zeitwerk (2.6.18)
98 |
99 | PLATFORMS
100 | ruby
101 |
102 | DEPENDENCIES
103 | activesupport (>= 6.1.7.5, != 7.1.0)
104 | benchmark
105 | bigdecimal
106 | cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
107 | concurrent-ruby (< 1.3.4)
108 | logger
109 | mutex_m
110 | xcodeproj (< 1.26.0)
111 |
112 | RUBY VERSION
113 | ruby 2.6.10p210
114 |
115 | BUNDLED WITH
116 | 1.17.2
117 |
--------------------------------------------------------------------------------
/00-Login/README.md:
--------------------------------------------------------------------------------
1 | # Auth0 React Native Samples - Login
2 |
3 | The complete guide to getting started with [react-native-auth0](https://github.com/auth0/react-native-auth0) is our [React Native QuickStart](https://auth0.com/docs/quickstart/native/react-native/00-login).
4 |
5 | ## 1. Install
6 |
7 | Clone the repository and install the dependencies with [Yarn](https://yarnpkg.com):
8 |
9 | ```bash
10 | git clone git@github.com:auth0-samples/auth0-react-native-sample.git
11 | cd auth0-react-native-sample
12 | yarn install
13 | ```
14 |
15 | ### iOS Applications only
16 |
17 | Change the directory into the `ios` folder and run the following command to install the SDK pod with [CocoaPods](https://cocoapods.org/):
18 |
19 | ```bash
20 | cd ios
21 | pod install
22 | ```
23 |
24 | You should see the `A0Auth0` pod being installed and linked to the sample app.
25 |
26 | ### Android applications only
27 |
28 | Open the `android/app/build.gradle` file and locate the following manifest placeholders:
29 |
30 | ```groovy
31 | android {
32 | defaultConfig {
33 | manifestPlaceholders = [auth0Domain: "YOUR_AUTH0_DOMAIN",
34 | auth0Scheme: "${applicationId}.auth0"]
35 | }
36 | ...
37 | }
38 | ```
39 |
40 | Replace `YOUR_AUTH0_DOMAIN` with your Auth0 domain value. If you have `samples.auth0.com` as your Auth0 domain you would have a configuration like the following:
41 |
42 | ```groovy
43 | android {
44 | defaultConfig {
45 | manifestPlaceholders = [auth0Domain: "samples.auth0.com",
46 | auth0Scheme: "${applicationId}.auth0"]
47 | }
48 | ...
49 | }
50 | ```
51 |
52 | The `applicationId` value will be auto-replaced at runtime with the package name or ID of your application (e.g. `com.example.app`).
53 |
54 | ## 2. Configure Auth0
55 |
56 | 1. Copy the `app/auth0-configuration.js.example` in this sample to `app/auth0-configuration.js`.
57 | 2. Open your [Applications in the Auth0 dashboard](https://manage.auth0.com/#/applications).
58 | 3. Select your existing Application from the list or click **Create Application** at the top to create a new Application of type **Native**.
59 | 4. On the **Settings** tab for the Application, copy the "Client ID" and "Domain" values and paste them into the `app/auth0-configuration.js` file created above.
60 | 5. In the **Allowed Callback URLs** field, paste in the text below and replace `YOUR_DOMAIN` with the **Domain** from above. These URLs are required for the authentication result to be redirected from the browser to the app:
61 |
62 | ```
63 | com.auth0samples.auth0://YOUR_DOMAIN/ios/com.auth0samples/callback,
64 | com.auth0samples.auth0://YOUR_DOMAIN/android/com.auth0samples/callback
65 | ```
66 |
67 | 6. Add the same values to the **Allowed Logout URLs** field as well. These are required for the browser to redirect back to the app after the user logs out.
68 | 7. Scroll down and click **Save Changes**.
69 |
70 | ## 3. Run The App
71 |
72 | Run your app on an emulator, simulator, or your own connected device.
73 |
74 | - To run the app on iOS run `yarn run ios`.
75 | - To run the app on Android run `yarn run android`.
76 |
77 | The first run may take a while to fully launch. Keep an eye out for confirmation windows and watch the terminal for output and results.
78 |
79 | **Note:** If you get an error about "No bundle URL present" try clicking reload in the app or running `yarn run ios` again.
80 |
--------------------------------------------------------------------------------
/00-Login/__tests__/App.test.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import React from 'react';
6 | import ReactTestRenderer from 'react-test-renderer';
7 | import App from '../App';
8 |
9 | test('renders correctly', async () => {
10 | await ReactTestRenderer.act(() => {
11 | ReactTestRenderer.create();
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/00-Login/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 | apply plugin: "org.jetbrains.kotlin.android"
3 | apply plugin: "com.facebook.react"
4 |
5 | /**
6 | * This is the configuration block to customize your React Native Android app.
7 | * By default you don't need to apply any configuration, just uncomment the lines you need.
8 | */
9 | react {
10 | /* Folders */
11 | // The root of your project, i.e. where "package.json" lives. Default is '../..'
12 | // root = file("../../")
13 | // The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14 | // reactNativeDir = file("../../node_modules/react-native")
15 | // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16 | // codegenDir = file("../../node_modules/@react-native/codegen")
17 | // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18 | // cliFile = file("../../node_modules/react-native/cli.js")
19 |
20 | /* Variants */
21 | // The list of variants to that are debuggable. For those we're going to
22 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
23 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24 | // debuggableVariants = ["liteDebug", "prodDebug"]
25 |
26 | /* Bundling */
27 | // A list containing the node command and its flags. Default is just 'node'.
28 | // nodeExecutableAndArgs = ["node"]
29 | //
30 | // The command to run when bundling. By default is 'bundle'
31 | // bundleCommand = "ram-bundle"
32 | //
33 | // The path to the CLI configuration file. Default is empty.
34 | // bundleConfig = file(../rn-cli.config.js)
35 | //
36 | // The name of the generated asset file containing your JS bundle
37 | // bundleAssetName = "MyApplication.android.bundle"
38 | //
39 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
40 | // entryFile = file("../js/MyApplication.android.js")
41 | //
42 | // A list of extra flags to pass to the 'bundle' commands.
43 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
44 | // extraPackagerArgs = []
45 |
46 | /* Hermes Commands */
47 | // The hermes compiler command to run. By default it is 'hermesc'
48 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
49 | //
50 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
51 | // hermesFlags = ["-O", "-output-source-map"]
52 |
53 | /* Autolinking */
54 | autolinkLibrariesWithApp()
55 | }
56 |
57 | /**
58 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
59 | */
60 | def enableProguardInReleaseBuilds = false
61 |
62 | /**
63 | * The preferred build flavor of JavaScriptCore (JSC)
64 | *
65 | * For example, to use the international variant, you can use:
66 | * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
67 | *
68 | * The international variant includes ICU i18n library and necessary data
69 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
70 | * give correct results when using with locales other than en-US. Note that
71 | * this variant is about 6MiB larger per architecture than default.
72 | */
73 | def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
74 |
75 | android {
76 | ndkVersion rootProject.ext.ndkVersion
77 | buildToolsVersion rootProject.ext.buildToolsVersion
78 | compileSdk rootProject.ext.compileSdkVersion
79 |
80 | namespace "com.auth0samples"
81 | defaultConfig {
82 | applicationId "com.auth0samples"
83 | manifestPlaceholders = [auth0Domain: "{DOMAIN}", auth0Scheme: "${applicationId}.auth0"]
84 | minSdkVersion rootProject.ext.minSdkVersion
85 | targetSdkVersion rootProject.ext.targetSdkVersion
86 | versionCode 1
87 | versionName "1.0"
88 | }
89 | signingConfigs {
90 | debug {
91 | storeFile file('debug.keystore')
92 | storePassword 'android'
93 | keyAlias 'androiddebugkey'
94 | keyPassword 'android'
95 | }
96 | }
97 | buildTypes {
98 | debug {
99 | signingConfig signingConfigs.debug
100 | }
101 | release {
102 | // Caution! In production, you need to generate your own keystore file.
103 | // see https://reactnative.dev/docs/signed-apk-android.
104 | signingConfig signingConfigs.debug
105 | minifyEnabled enableProguardInReleaseBuilds
106 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
107 | }
108 | }
109 | }
110 |
111 | dependencies {
112 | // The version of react-native is set by the React Native Gradle Plugin
113 | implementation("com.facebook.react:react-android")
114 |
115 | if (hermesEnabled.toBoolean()) {
116 | implementation("com.facebook.react:hermes-android")
117 | } else {
118 | implementation jscFlavor
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/00-Login/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/debug.keystore
--------------------------------------------------------------------------------
/00-Login/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/00-Login/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/java/com/auth0samples/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.auth0samples
2 |
3 | import com.facebook.react.ReactActivity
4 | import com.facebook.react.ReactActivityDelegate
5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6 | import com.facebook.react.defaults.DefaultReactActivityDelegate
7 |
8 | class MainActivity : ReactActivity() {
9 |
10 | /**
11 | * Returns the name of the main component registered from JavaScript. This is used to schedule
12 | * rendering of the component.
13 | */
14 | override fun getMainComponentName(): String = "Auth0Sample"
15 |
16 | /**
17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19 | */
20 | override fun createReactActivityDelegate(): ReactActivityDelegate =
21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22 | }
23 |
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/java/com/auth0samples/MainApplication.kt:
--------------------------------------------------------------------------------
1 | package com.auth0samples
2 |
3 | import android.app.Application
4 | import com.facebook.react.PackageList
5 | import com.facebook.react.ReactApplication
6 | import com.facebook.react.ReactHost
7 | import com.facebook.react.ReactNativeHost
8 | import com.facebook.react.ReactPackage
9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11 | import com.facebook.react.defaults.DefaultReactNativeHost
12 | import com.facebook.react.soloader.OpenSourceMergedSoMapping
13 | import com.facebook.soloader.SoLoader
14 |
15 | class MainApplication : Application(), ReactApplication {
16 |
17 | override val reactNativeHost: ReactNativeHost =
18 | object : DefaultReactNativeHost(this) {
19 | override fun getPackages(): List =
20 | PackageList(this).packages.apply {
21 | // Packages that cannot be autolinked yet can be added manually here, for example:
22 | // add(MyReactNativePackage())
23 | }
24 |
25 | override fun getJSMainModuleName(): String = "index"
26 |
27 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28 |
29 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31 | }
32 |
33 | override val reactHost: ReactHost
34 | get() = getDefaultReactHost(applicationContext, reactNativeHost)
35 |
36 | override fun onCreate() {
37 | super.onCreate()
38 | SoLoader.init(this, OpenSourceMergedSoMapping)
39 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40 | // If you opted-in for the New Architecture, we load the native entry point for this app.
41 | load()
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/drawable/rn_edit_text_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
22 |
23 |
24 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Auth0Sample
3 |
4 |
--------------------------------------------------------------------------------
/00-Login/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/00-Login/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | buildToolsVersion = "35.0.0"
4 | minSdkVersion = 24
5 | compileSdkVersion = 35
6 | targetSdkVersion = 35
7 | ndkVersion = "27.1.12297006"
8 | kotlinVersion = "2.0.21"
9 | }
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | dependencies {
15 | classpath("com.android.tools.build:gradle")
16 | classpath("com.facebook.react:react-native-gradle-plugin")
17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
18 | }
19 | }
20 |
21 | apply plugin: "com.facebook.react.rootproject"
22 |
--------------------------------------------------------------------------------
/00-Login/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 |
25 | # Use this property to specify which architecture you want to build.
26 | # You can also override it from the CLI using
27 | # ./gradlew -PreactNativeArchitectures=x86_64
28 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
29 |
30 | # Use this property to enable support to the new architecture.
31 | # This will allow you to use TurboModules and the Fabric render in
32 | # your application. You should enable this flag either if you want
33 | # to write custom TurboModules/Fabric components OR use libraries that
34 | # are providing them.
35 | newArchEnabled=true
36 |
37 | # Use this property to enable or disable the Hermes JS engine.
38 | # If set to false, you will be using JSC instead.
39 | hermesEnabled=true
40 |
--------------------------------------------------------------------------------
/00-Login/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/auth0-samples/auth0-react-native-sample/4c74d9751fa73f8ab293c2001d84bfd8cc7c2cd6/00-Login/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/00-Login/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/00-Login/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | # SPDX-License-Identifier: Apache-2.0
19 | #
20 |
21 | ##############################################################################
22 | #
23 | # Gradle start up script for POSIX generated by Gradle.
24 | #
25 | # Important for running:
26 | #
27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28 | # noncompliant, but you have some other compliant shell such as ksh or
29 | # bash, then to run this script, type that shell name before the whole
30 | # command line, like:
31 | #
32 | # ksh Gradle
33 | #
34 | # Busybox and similar reduced shells will NOT work, because this script
35 | # requires all of these POSIX shell features:
36 | # * functions;
37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39 | # * compound commands having a testable exit status, especially «case»;
40 | # * various built-in commands including «command», «set», and «ulimit».
41 | #
42 | # Important for patching:
43 | #
44 | # (2) This script targets any POSIX shell, so it avoids extensions provided
45 | # by Bash, Ksh, etc; in particular arrays are avoided.
46 | #
47 | # The "traditional" practice of packing multiple parameters into a
48 | # space-separated string is a well documented source of bugs and security
49 | # problems, so this is (mostly) avoided, by progressively accumulating
50 | # options in "$@", and eventually passing that to Java.
51 | #
52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54 | # see the in-line comments for details.
55 | #
56 | # There are tweaks for specific operating systems such as AIX, CygWin,
57 | # Darwin, MinGW, and NonStop.
58 | #
59 | # (3) This script is generated from the Groovy template
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61 | # within the Gradle project.
62 | #
63 | # You can find Gradle at https://github.com/gradle/gradle/.
64 | #
65 | ##############################################################################
66 |
67 | # Attempt to set APP_HOME
68 |
69 | # Resolve links: $0 may be a link
70 | app_path=$0
71 |
72 | # Need this for daisy-chained symlinks.
73 | while
74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75 | [ -h "$app_path" ]
76 | do
77 | ls=$( ls -ld "$app_path" )
78 | link=${ls#*' -> '}
79 | case $link in #(
80 | /*) app_path=$link ;; #(
81 | *) app_path=$APP_HOME$link ;;
82 | esac
83 | done
84 |
85 | # This is normally unused
86 | # shellcheck disable=SC2034
87 | APP_BASE_NAME=${0##*/}
88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | if ! command -v java >/dev/null 2>&1
137 | then
138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
139 |
140 | Please set the JAVA_HOME variable in your environment to match the
141 | location of your Java installation."
142 | fi
143 | fi
144 |
145 | # Increase the maximum file descriptors if we can.
146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
147 | case $MAX_FD in #(
148 | max*)
149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
150 | # shellcheck disable=SC2039,SC3045
151 | MAX_FD=$( ulimit -H -n ) ||
152 | warn "Could not query maximum file descriptor limit"
153 | esac
154 | case $MAX_FD in #(
155 | '' | soft) :;; #(
156 | *)
157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
158 | # shellcheck disable=SC2039,SC3045
159 | ulimit -n "$MAX_FD" ||
160 | warn "Could not set maximum file descriptor limit to $MAX_FD"
161 | esac
162 | fi
163 |
164 | # Collect all arguments for the java command, stacking in reverse order:
165 | # * args from the command line
166 | # * the main class name
167 | # * -classpath
168 | # * -D...appname settings
169 | # * --module-path (only if needed)
170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
171 |
172 | # For Cygwin or MSYS, switch paths to Windows format before running java
173 | if "$cygwin" || "$msys" ; then
174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176 |
177 | JAVACMD=$( cygpath --unix "$JAVACMD" )
178 |
179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
180 | for arg do
181 | if
182 | case $arg in #(
183 | -*) false ;; # don't mess with options #(
184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
185 | [ -e "$t" ] ;; #(
186 | *) false ;;
187 | esac
188 | then
189 | arg=$( cygpath --path --ignore --mixed "$arg" )
190 | fi
191 | # Roll the args list around exactly as many times as the number of
192 | # args, so each arg winds up back in the position where it started, but
193 | # possibly modified.
194 | #
195 | # NB: a `for` loop captures its iteration list before it begins, so
196 | # changing the positional parameters here affects neither the number of
197 | # iterations, nor the values presented in `arg`.
198 | shift # remove old arg
199 | set -- "$@" "$arg" # push replacement arg
200 | done
201 | fi
202 |
203 |
204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206 |
207 | # Collect all arguments for the java command:
208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209 | # and any embedded shellness will be escaped.
210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211 | # treated as '${Hostname}' itself on the command line.
212 |
213 | set -- \
214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
215 | -classpath "$CLASSPATH" \
216 | org.gradle.wrapper.GradleWrapperMain \
217 | "$@"
218 |
219 | # Stop when "xargs" is not available.
220 | if ! command -v xargs >/dev/null 2>&1
221 | then
222 | die "xargs is not available"
223 | fi
224 |
225 | # Use "xargs" to parse quoted args.
226 | #
227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
228 | #
229 | # In Bash we could simply go:
230 | #
231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
232 | # set -- "${ARGS[@]}" "$@"
233 | #
234 | # but POSIX shell has neither arrays nor command substitution, so instead we
235 | # post-process each arg (as a line of input to sed) to backslash-escape any
236 | # character that might be a shell metacharacter, then use eval to reverse
237 | # that process (while maintaining the separation between arguments), and wrap
238 | # the whole thing up as a single "set" statement.
239 | #
240 | # This will of course break if any of these variables contains a newline or
241 | # an unmatched quote.
242 | #
243 |
244 | eval "set -- $(
245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
246 | xargs -n1 |
247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
248 | tr '\n' ' '
249 | )" '"$@"'
250 |
251 | exec "$JAVACMD" "$@"
252 |
--------------------------------------------------------------------------------
/00-Login/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
74 |
75 |
76 | @rem Execute Gradle
77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
78 |
79 | :end
80 | @rem End local scope for the variables with windows NT shell
81 | if %ERRORLEVEL% equ 0 goto mainEnd
82 |
83 | :fail
84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85 | rem the _cmd.exe /c_ return code!
86 | set EXIT_CODE=%ERRORLEVEL%
87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89 | exit /b %EXIT_CODE%
90 |
91 | :mainEnd
92 | if "%OS%"=="Windows_NT" endlocal
93 |
94 | :omega
95 |
--------------------------------------------------------------------------------
/00-Login/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2 | plugins { id("com.facebook.react.settings") }
3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
4 | rootProject.name = "Auth0Sample"
5 | include ':app'
6 | includeBuild('../node_modules/@react-native/gradle-plugin')
7 |
--------------------------------------------------------------------------------
/00-Login/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Auth0Sample",
3 | "displayName": "Auth0Sample"
4 | }
5 |
--------------------------------------------------------------------------------
/00-Login/auth0-configuration.js.example:
--------------------------------------------------------------------------------
1 | const config = {
2 | clientId: "{CLIENT_ID}",
3 | domain: "{DOMAIN}"
4 | };
5 |
6 | export default config;
--------------------------------------------------------------------------------
/00-Login/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:@react-native/babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/00-Login/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import {AppRegistry} from 'react-native';
6 | import App from './App';
7 | import {name as appName} from './app.json';
8 |
9 | AppRegistry.registerComponent(appName, () => App);
10 |
--------------------------------------------------------------------------------
/00-Login/ios/.xcode.env:
--------------------------------------------------------------------------------
1 | # This `.xcode.env` file is versioned and is used to source the environment
2 | # used when running script phases inside Xcode.
3 | # To customize your local environment, you can create an `.xcode.env.local`
4 | # file that is not versioned.
5 |
6 | # NODE_BINARY variable contains the PATH to the node executable.
7 | #
8 | # Customize the NODE_BINARY variable here.
9 | # For example, to use nvm with brew, add the following line
10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use
11 | export NODE_BINARY=$(command -v node)
12 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0C80B921A6F3F58F76C31292 /* libPods-Auth0Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-Auth0Sample.a */; };
11 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
12 | 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
13 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
14 | C49D226ACE8E41B78B1F1650 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXFileReference section */
18 | 13B07F961A680F5B00A75B9A /* Auth0Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Auth0Sample.app; sourceTree = BUILT_PRODUCTS_DIR; };
19 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Auth0Sample/Images.xcassets; sourceTree = ""; };
20 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Auth0Sample/Info.plist; sourceTree = ""; };
21 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = Auth0Sample/PrivacyInfo.xcprivacy; sourceTree = ""; };
22 | 3B4392A12AC88292D35C810B /* Pods-Auth0Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Auth0Sample.debug.xcconfig"; path = "Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample.debug.xcconfig"; sourceTree = ""; };
23 | 5709B34CF0A7D63546082F79 /* Pods-Auth0Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Auth0Sample.release.xcconfig"; path = "Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample.release.xcconfig"; sourceTree = ""; };
24 | 5DCACB8F33CDC322A6C60F78 /* libPods-Auth0Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Auth0Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
25 | 761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Auth0Sample/AppDelegate.swift; sourceTree = ""; };
26 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Auth0Sample/LaunchScreen.storyboard; sourceTree = ""; };
27 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
28 | /* End PBXFileReference section */
29 |
30 | /* Begin PBXFrameworksBuildPhase section */
31 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
32 | isa = PBXFrameworksBuildPhase;
33 | buildActionMask = 2147483647;
34 | files = (
35 | 0C80B921A6F3F58F76C31292 /* libPods-Auth0Sample.a in Frameworks */,
36 | );
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXFrameworksBuildPhase section */
40 |
41 | /* Begin PBXGroup section */
42 | 13B07FAE1A68108700A75B9A /* Auth0Sample */ = {
43 | isa = PBXGroup;
44 | children = (
45 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
46 | 761780EC2CA45674006654EE /* AppDelegate.swift */,
47 | 13B07FB61A68108700A75B9A /* Info.plist */,
48 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
49 | 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
50 | );
51 | name = Auth0Sample;
52 | sourceTree = "";
53 | };
54 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
55 | isa = PBXGroup;
56 | children = (
57 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
58 | 5DCACB8F33CDC322A6C60F78 /* libPods-Auth0Sample.a */,
59 | );
60 | name = Frameworks;
61 | sourceTree = "";
62 | };
63 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
64 | isa = PBXGroup;
65 | children = (
66 | );
67 | name = Libraries;
68 | sourceTree = "";
69 | };
70 | 83CBB9F61A601CBA00E9B192 = {
71 | isa = PBXGroup;
72 | children = (
73 | 13B07FAE1A68108700A75B9A /* Auth0Sample */,
74 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
75 | 83CBBA001A601CBA00E9B192 /* Products */,
76 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
77 | BBD78D7AC51CEA395F1C20DB /* Pods */,
78 | );
79 | indentWidth = 2;
80 | sourceTree = "";
81 | tabWidth = 2;
82 | usesTabs = 0;
83 | };
84 | 83CBBA001A601CBA00E9B192 /* Products */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 13B07F961A680F5B00A75B9A /* Auth0Sample.app */,
88 | );
89 | name = Products;
90 | sourceTree = "";
91 | };
92 | BBD78D7AC51CEA395F1C20DB /* Pods */ = {
93 | isa = PBXGroup;
94 | children = (
95 | 3B4392A12AC88292D35C810B /* Pods-Auth0Sample.debug.xcconfig */,
96 | 5709B34CF0A7D63546082F79 /* Pods-Auth0Sample.release.xcconfig */,
97 | );
98 | path = Pods;
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 13B07F861A680F5B00A75B9A /* Auth0Sample */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Auth0Sample" */;
107 | buildPhases = (
108 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
109 | 13B07F871A680F5B00A75B9A /* Sources */,
110 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
111 | 13B07F8E1A680F5B00A75B9A /* Resources */,
112 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
113 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
114 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
115 | );
116 | buildRules = (
117 | );
118 | dependencies = (
119 | );
120 | name = Auth0Sample;
121 | productName = Auth0Sample;
122 | productReference = 13B07F961A680F5B00A75B9A /* Auth0Sample.app */;
123 | productType = "com.apple.product-type.application";
124 | };
125 | /* End PBXNativeTarget section */
126 |
127 | /* Begin PBXProject section */
128 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
129 | isa = PBXProject;
130 | attributes = {
131 | LastUpgradeCheck = 1210;
132 | TargetAttributes = {
133 | 13B07F861A680F5B00A75B9A = {
134 | LastSwiftMigration = 1120;
135 | };
136 | };
137 | };
138 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Auth0Sample" */;
139 | compatibilityVersion = "Xcode 12.0";
140 | developmentRegion = en;
141 | hasScannedForEncodings = 0;
142 | knownRegions = (
143 | en,
144 | Base,
145 | );
146 | mainGroup = 83CBB9F61A601CBA00E9B192;
147 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
148 | projectDirPath = "";
149 | projectRoot = "";
150 | targets = (
151 | 13B07F861A680F5B00A75B9A /* Auth0Sample */,
152 | );
153 | };
154 | /* End PBXProject section */
155 |
156 | /* Begin PBXResourcesBuildPhase section */
157 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
158 | isa = PBXResourcesBuildPhase;
159 | buildActionMask = 2147483647;
160 | files = (
161 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
162 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
163 | C49D226ACE8E41B78B1F1650 /* PrivacyInfo.xcprivacy in Resources */,
164 | );
165 | runOnlyForDeploymentPostprocessing = 0;
166 | };
167 | /* End PBXResourcesBuildPhase section */
168 |
169 | /* Begin PBXShellScriptBuildPhase section */
170 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
171 | isa = PBXShellScriptBuildPhase;
172 | buildActionMask = 2147483647;
173 | files = (
174 | );
175 | inputPaths = (
176 | "$(SRCROOT)/.xcode.env.local",
177 | "$(SRCROOT)/.xcode.env",
178 | );
179 | name = "Bundle React Native code and images";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
185 | };
186 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputFileListPaths = (
192 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
193 | );
194 | name = "[CP] Embed Pods Frameworks";
195 | outputFileListPaths = (
196 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
197 | );
198 | runOnlyForDeploymentPostprocessing = 0;
199 | shellPath = /bin/sh;
200 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-frameworks.sh\"\n";
201 | showEnvVarsInLog = 0;
202 | };
203 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
204 | isa = PBXShellScriptBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | );
208 | inputFileListPaths = (
209 | );
210 | inputPaths = (
211 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
212 | "${PODS_ROOT}/Manifest.lock",
213 | );
214 | name = "[CP] Check Pods Manifest.lock";
215 | outputFileListPaths = (
216 | );
217 | outputPaths = (
218 | "$(DERIVED_FILE_DIR)/Pods-Auth0Sample-checkManifestLockResult.txt",
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | shellPath = /bin/sh;
222 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
223 | showEnvVarsInLog = 0;
224 | };
225 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
226 | isa = PBXShellScriptBuildPhase;
227 | buildActionMask = 2147483647;
228 | files = (
229 | );
230 | inputFileListPaths = (
231 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-resources-${CONFIGURATION}-input-files.xcfilelist",
232 | );
233 | name = "[CP] Copy Pods Resources";
234 | outputFileListPaths = (
235 | "${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-resources-${CONFIGURATION}-output-files.xcfilelist",
236 | );
237 | runOnlyForDeploymentPostprocessing = 0;
238 | shellPath = /bin/sh;
239 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Auth0Sample/Pods-Auth0Sample-resources.sh\"\n";
240 | showEnvVarsInLog = 0;
241 | };
242 | /* End PBXShellScriptBuildPhase section */
243 |
244 | /* Begin PBXSourcesBuildPhase section */
245 | 13B07F871A680F5B00A75B9A /* Sources */ = {
246 | isa = PBXSourcesBuildPhase;
247 | buildActionMask = 2147483647;
248 | files = (
249 | 761780ED2CA45674006654EE /* AppDelegate.swift in Sources */,
250 | );
251 | runOnlyForDeploymentPostprocessing = 0;
252 | };
253 | /* End PBXSourcesBuildPhase section */
254 |
255 | /* Begin XCBuildConfiguration section */
256 | 13B07F941A680F5B00A75B9A /* Debug */ = {
257 | isa = XCBuildConfiguration;
258 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-Auth0Sample.debug.xcconfig */;
259 | buildSettings = {
260 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
261 | CLANG_ENABLE_MODULES = YES;
262 | CURRENT_PROJECT_VERSION = 1;
263 | ENABLE_BITCODE = NO;
264 | INFOPLIST_FILE = Auth0Sample/Info.plist;
265 | INFOPLIST_KEY_CFBundleDisplayName = Auth0Sample;
266 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
267 | LD_RUNPATH_SEARCH_PATHS = (
268 | "$(inherited)",
269 | "@executable_path/Frameworks",
270 | );
271 | MARKETING_VERSION = 1.0;
272 | OTHER_LDFLAGS = (
273 | "$(inherited)",
274 | "-ObjC",
275 | "-lc++",
276 | );
277 | PRODUCT_BUNDLE_IDENTIFIER = com.auth0samples;
278 | PRODUCT_NAME = Auth0Sample;
279 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
280 | SWIFT_VERSION = 5.0;
281 | VERSIONING_SYSTEM = "apple-generic";
282 | };
283 | name = Debug;
284 | };
285 | 13B07F951A680F5B00A75B9A /* Release */ = {
286 | isa = XCBuildConfiguration;
287 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-Auth0Sample.release.xcconfig */;
288 | buildSettings = {
289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
290 | CLANG_ENABLE_MODULES = YES;
291 | CURRENT_PROJECT_VERSION = 1;
292 | INFOPLIST_FILE = Auth0Sample/Info.plist;
293 | INFOPLIST_KEY_CFBundleDisplayName = Auth0Sample;
294 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
295 | LD_RUNPATH_SEARCH_PATHS = (
296 | "$(inherited)",
297 | "@executable_path/Frameworks",
298 | );
299 | MARKETING_VERSION = 1.0;
300 | OTHER_LDFLAGS = (
301 | "$(inherited)",
302 | "-ObjC",
303 | "-lc++",
304 | );
305 | PRODUCT_BUNDLE_IDENTIFIER = com.auth0samples;
306 | PRODUCT_NAME = Auth0Sample;
307 | SWIFT_VERSION = 5.0;
308 | VERSIONING_SYSTEM = "apple-generic";
309 | };
310 | name = Release;
311 | };
312 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
313 | isa = XCBuildConfiguration;
314 | buildSettings = {
315 | ALWAYS_SEARCH_USER_PATHS = NO;
316 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
317 | CLANG_CXX_LANGUAGE_STANDARD = "c++20";
318 | CLANG_CXX_LIBRARY = "libc++";
319 | CLANG_ENABLE_MODULES = YES;
320 | CLANG_ENABLE_OBJC_ARC = YES;
321 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
322 | CLANG_WARN_BOOL_CONVERSION = YES;
323 | CLANG_WARN_COMMA = YES;
324 | CLANG_WARN_CONSTANT_CONVERSION = YES;
325 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
326 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
327 | CLANG_WARN_EMPTY_BODY = YES;
328 | CLANG_WARN_ENUM_CONVERSION = YES;
329 | CLANG_WARN_INFINITE_RECURSION = YES;
330 | CLANG_WARN_INT_CONVERSION = YES;
331 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
332 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
333 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
334 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
335 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
336 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
337 | CLANG_WARN_STRICT_PROTOTYPES = YES;
338 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
339 | CLANG_WARN_UNREACHABLE_CODE = YES;
340 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
341 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
342 | COPY_PHASE_STRIP = NO;
343 | ENABLE_STRICT_OBJC_MSGSEND = YES;
344 | ENABLE_TESTABILITY = YES;
345 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
346 | GCC_C_LANGUAGE_STANDARD = gnu99;
347 | GCC_DYNAMIC_NO_PIC = NO;
348 | GCC_NO_COMMON_BLOCKS = YES;
349 | GCC_OPTIMIZATION_LEVEL = 0;
350 | GCC_PREPROCESSOR_DEFINITIONS = (
351 | "DEBUG=1",
352 | "$(inherited)",
353 | );
354 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
355 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
356 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
357 | GCC_WARN_UNDECLARED_SELECTOR = YES;
358 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
359 | GCC_WARN_UNUSED_FUNCTION = YES;
360 | GCC_WARN_UNUSED_VARIABLE = YES;
361 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
362 | LD_RUNPATH_SEARCH_PATHS = (
363 | /usr/lib/swift,
364 | "$(inherited)",
365 | );
366 | LIBRARY_SEARCH_PATHS = (
367 | "\"$(SDKROOT)/usr/lib/swift\"",
368 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
369 | "\"$(inherited)\"",
370 | );
371 | MTL_ENABLE_DEBUG_INFO = YES;
372 | ONLY_ACTIVE_ARCH = YES;
373 | OTHER_CPLUSPLUSFLAGS = (
374 | "$(OTHER_CFLAGS)",
375 | "-DFOLLY_NO_CONFIG",
376 | "-DFOLLY_MOBILE=1",
377 | "-DFOLLY_USE_LIBCPP=1",
378 | "-DFOLLY_CFG_NO_COROUTINES=1",
379 | "-DFOLLY_HAVE_CLOCK_GETTIME=1",
380 | );
381 | OTHER_LDFLAGS = (
382 | "$(inherited)",
383 | " ",
384 | );
385 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
386 | SDKROOT = iphoneos;
387 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
388 | USE_HERMES = true;
389 | };
390 | name = Debug;
391 | };
392 | 83CBBA211A601CBA00E9B192 /* Release */ = {
393 | isa = XCBuildConfiguration;
394 | buildSettings = {
395 | ALWAYS_SEARCH_USER_PATHS = NO;
396 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
397 | CLANG_CXX_LANGUAGE_STANDARD = "c++20";
398 | CLANG_CXX_LIBRARY = "libc++";
399 | CLANG_ENABLE_MODULES = YES;
400 | CLANG_ENABLE_OBJC_ARC = YES;
401 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
402 | CLANG_WARN_BOOL_CONVERSION = YES;
403 | CLANG_WARN_COMMA = YES;
404 | CLANG_WARN_CONSTANT_CONVERSION = YES;
405 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
406 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
407 | CLANG_WARN_EMPTY_BODY = YES;
408 | CLANG_WARN_ENUM_CONVERSION = YES;
409 | CLANG_WARN_INFINITE_RECURSION = YES;
410 | CLANG_WARN_INT_CONVERSION = YES;
411 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
412 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
413 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
414 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
415 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
416 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
417 | CLANG_WARN_STRICT_PROTOTYPES = YES;
418 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
419 | CLANG_WARN_UNREACHABLE_CODE = YES;
420 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
421 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
422 | COPY_PHASE_STRIP = YES;
423 | ENABLE_NS_ASSERTIONS = NO;
424 | ENABLE_STRICT_OBJC_MSGSEND = YES;
425 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
426 | GCC_C_LANGUAGE_STANDARD = gnu99;
427 | GCC_NO_COMMON_BLOCKS = YES;
428 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
429 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
430 | GCC_WARN_UNDECLARED_SELECTOR = YES;
431 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
432 | GCC_WARN_UNUSED_FUNCTION = YES;
433 | GCC_WARN_UNUSED_VARIABLE = YES;
434 | IPHONEOS_DEPLOYMENT_TARGET = 15.1;
435 | LD_RUNPATH_SEARCH_PATHS = (
436 | /usr/lib/swift,
437 | "$(inherited)",
438 | );
439 | LIBRARY_SEARCH_PATHS = (
440 | "\"$(SDKROOT)/usr/lib/swift\"",
441 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
442 | "\"$(inherited)\"",
443 | );
444 | MTL_ENABLE_DEBUG_INFO = NO;
445 | OTHER_CPLUSPLUSFLAGS = (
446 | "$(OTHER_CFLAGS)",
447 | "-DFOLLY_NO_CONFIG",
448 | "-DFOLLY_MOBILE=1",
449 | "-DFOLLY_USE_LIBCPP=1",
450 | "-DFOLLY_CFG_NO_COROUTINES=1",
451 | "-DFOLLY_HAVE_CLOCK_GETTIME=1",
452 | );
453 | OTHER_LDFLAGS = (
454 | "$(inherited)",
455 | " ",
456 | );
457 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
458 | SDKROOT = iphoneos;
459 | USE_HERMES = true;
460 | VALIDATE_PRODUCT = YES;
461 | };
462 | name = Release;
463 | };
464 | /* End XCBuildConfiguration section */
465 |
466 | /* Begin XCConfigurationList section */
467 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Auth0Sample" */ = {
468 | isa = XCConfigurationList;
469 | buildConfigurations = (
470 | 13B07F941A680F5B00A75B9A /* Debug */,
471 | 13B07F951A680F5B00A75B9A /* Release */,
472 | );
473 | defaultConfigurationIsVisible = 0;
474 | defaultConfigurationName = Release;
475 | };
476 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Auth0Sample" */ = {
477 | isa = XCConfigurationList;
478 | buildConfigurations = (
479 | 83CBBA201A601CBA00E9B192 /* Debug */,
480 | 83CBBA211A601CBA00E9B192 /* Release */,
481 | );
482 | defaultConfigurationIsVisible = 0;
483 | defaultConfigurationName = Release;
484 | };
485 | /* End XCConfigurationList section */
486 | };
487 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
488 | }
489 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample.xcodeproj/xcshareddata/xcschemes/Auth0Sample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import React
3 | import React_RCTAppDelegate
4 | import ReactAppDependencyProvider
5 |
6 | @main
7 | class AppDelegate: UIResponder, UIApplicationDelegate {
8 | var window: UIWindow?
9 |
10 | var reactNativeDelegate: ReactNativeDelegate?
11 | var reactNativeFactory: RCTReactNativeFactory?
12 |
13 | func application(
14 | _ application: UIApplication,
15 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
16 | ) -> Bool {
17 | let delegate = ReactNativeDelegate()
18 | let factory = RCTReactNativeFactory(delegate: delegate)
19 | delegate.dependencyProvider = RCTAppDependencyProvider()
20 |
21 | reactNativeDelegate = delegate
22 | reactNativeFactory = factory
23 |
24 | window = UIWindow(frame: UIScreen.main.bounds)
25 |
26 | factory.startReactNative(
27 | withModuleName: "Auth0Sample",
28 | in: window,
29 | launchOptions: launchOptions
30 | )
31 |
32 | return true
33 | }
34 |
35 | func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
36 | return RCTLinkingManager.application(app, open: url, options: options)
37 | }
38 | }
39 |
40 | class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
41 | override func sourceURL(for bridge: RCTBridge) -> URL? {
42 | self.bundleURL()
43 | }
44 |
45 | override func bundleURL() -> URL? {
46 | #if DEBUG
47 | RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
48 | #else
49 | Bundle.main.url(forResource: "main", withExtension: "jsbundle")
50 | #endif
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "scale" : "1x",
46 | "size" : "1024x1024"
47 | }
48 | ],
49 | "info" : {
50 | "author" : "xcode",
51 | "version" : 1
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Auth0Sample
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleURLTypes
14 |
15 |
16 | CFBundleTypeRole
17 | None
18 | CFBundleURLName
19 | auth0
20 | CFBundleURLSchemes
21 |
22 | $(PRODUCT_BUNDLE_IDENTIFIER).auth0
23 |
24 |
25 |
26 | CFBundleInfoDictionaryVersion
27 | 6.0
28 | CFBundleName
29 | $(PRODUCT_NAME)
30 | CFBundlePackageType
31 | APPL
32 | CFBundleShortVersionString
33 | $(MARKETING_VERSION)
34 | CFBundleSignature
35 | ????
36 | CFBundleVersion
37 | $(CURRENT_PROJECT_VERSION)
38 | LSRequiresIPhoneOS
39 |
40 | NSAppTransportSecurity
41 |
42 | NSAllowsArbitraryLoads
43 |
44 | NSAllowsLocalNetworking
45 |
46 |
47 | NSLocationWhenInUseUsageDescription
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | UIRequiredDeviceCapabilities
52 |
53 | arm64
54 |
55 | UISupportedInterfaceOrientations
56 |
57 | UIInterfaceOrientationPortrait
58 | UIInterfaceOrientationLandscapeLeft
59 | UIInterfaceOrientationLandscapeRight
60 |
61 | UIViewControllerBasedStatusBarAppearance
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/00-Login/ios/Auth0Sample/PrivacyInfo.xcprivacy:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSPrivacyAccessedAPITypes
6 |
7 |
8 | NSPrivacyAccessedAPIType
9 | NSPrivacyAccessedAPICategoryFileTimestamp
10 | NSPrivacyAccessedAPITypeReasons
11 |
12 | C617.1
13 |
14 |
15 |
16 | NSPrivacyAccessedAPIType
17 | NSPrivacyAccessedAPICategoryUserDefaults
18 | NSPrivacyAccessedAPITypeReasons
19 |
20 | CA92.1
21 |
22 |
23 |
24 | NSPrivacyAccessedAPIType
25 | NSPrivacyAccessedAPICategorySystemBootTime
26 | NSPrivacyAccessedAPITypeReasons
27 |
28 | 35F9.1
29 |
30 |
31 |
32 | NSPrivacyCollectedDataTypes
33 |
34 | NSPrivacyTracking
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/00-Login/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Resolve react_native_pods.rb with node to allow for hoisting
2 | require Pod::Executable.execute_command('node', ['-p',
3 | 'require.resolve(
4 | "react-native/scripts/react_native_pods.rb",
5 | {paths: [process.argv[1]]},
6 | )', __dir__]).strip
7 |
8 | platform :ios, min_ios_version_supported
9 | prepare_react_native_project!
10 |
11 | linkage = ENV['USE_FRAMEWORKS']
12 | if linkage != nil
13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
14 | use_frameworks! :linkage => linkage.to_sym
15 | end
16 |
17 | target 'Auth0Sample' do
18 | config = use_native_modules!
19 |
20 | use_react_native!(
21 | :path => config[:reactNativePath],
22 | # An absolute path to your application root.
23 | :app_path => "#{Pod::Config.instance.installation_root}/.."
24 | )
25 |
26 | post_install do |installer|
27 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
28 | react_native_post_install(
29 | installer,
30 | config[:reactNativePath],
31 | :mac_catalyst_enabled => false,
32 | # :ccache_enabled => true
33 | )
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/00-Login/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | preset: 'react-native',
3 | };
4 |
--------------------------------------------------------------------------------
/00-Login/metro.config.js:
--------------------------------------------------------------------------------
1 | const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
2 |
3 | /**
4 | * Metro configuration
5 | * https://reactnative.dev/docs/metro
6 | *
7 | * @type {import('@react-native/metro-config').MetroConfig}
8 | */
9 | const config = {};
10 |
11 | module.exports = mergeConfig(getDefaultConfig(__dirname), config);
12 |
--------------------------------------------------------------------------------
/00-Login/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "auth0sample",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "lint": "eslint .",
9 | "start": "react-native start",
10 | "test": "jest"
11 | },
12 | "dependencies": {
13 | "react": "19.0.0",
14 | "react-native": "0.79.2",
15 | "react-native-auth0": "^5.0.0-beta.1"
16 | },
17 | "devDependencies": {
18 | "@babel/core": "^7.25.2",
19 | "@babel/preset-env": "^7.25.3",
20 | "@babel/runtime": "^7.25.0",
21 | "@react-native-community/cli": "18.0.0",
22 | "@react-native-community/cli-platform-android": "18.0.0",
23 | "@react-native-community/cli-platform-ios": "18.0.0",
24 | "@react-native/babel-preset": "0.79.2",
25 | "@react-native/eslint-config": "0.79.2",
26 | "@react-native/metro-config": "0.79.2",
27 | "@react-native/typescript-config": "0.79.2",
28 | "@types/jest": "^29.5.13",
29 | "@types/react": "^19.0.0",
30 | "@types/react-test-renderer": "^19.0.0",
31 | "eslint": "^8.19.0",
32 | "jest": "^29.6.3",
33 | "prettier": "2.8.8",
34 | "react-test-renderer": "19.1.0",
35 | "typescript": "5.0.4"
36 | },
37 | "engines": {
38 | "node": ">=18"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/00-Login/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@react-native/typescript-config/tsconfig.json"
3 | }
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Auth0 Samples
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Auth0 React Native Sample
2 |
3 | This is the sample code for the [Auth0 React Native Quickstart](https://auth0.com/docs/quickstart/native/react-native) using the [Auth0 React Native SDK](https://github.com/auth0/react-native-auth0/).
4 |
5 | Please see [the sample applications](https://github.com/auth0-samples/auth0-react-native-sample/tree/master/00-Login) that demonstrate integrating the Auth0 React Native SDK into your application
6 |
7 | ## What is Auth0?
8 |
9 | Auth0 helps you to:
10 |
11 | * Add authentication with [multiple sources](https://auth0.com/docs/identityproviders), either social identity providers such as **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce** (amongst others), or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS, or any SAML Identity Provider**.
12 | * Add authentication through more traditional **[username/password databases](https://auth0.com/docs/connections/database/custom-db)**.
13 | * Add support for **[linking different user accounts](https://auth0.com/docs/users/user-account-linking)** with the same user.
14 | * Support for generating signed [JSON Web Tokens](https://auth0.com/docs/tokens/json-web-tokens) to call your APIs and **flow the user identity** securely.
15 | * Analytics of how, when, and where users are logging in.
16 | * Pull data from other sources and add it to the user profile through [JavaScript rules](https://auth0.com/docs/rules).
17 |
18 | ## Create a Free Auth0 Account
19 |
20 | 1. Go to [Auth0](https://auth0.com) and click **Sign Up**.
21 | 2. Use Google, GitHub, or Microsoft Account to login.
22 |
23 | ## Issue Reporting
24 |
25 | 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](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.
26 |
27 | ## Author
28 |
29 | [Auth0](https://auth0.com)
30 |
31 | ## License
32 |
33 | This project is licensed under the MIT license. See the [LICENSE](./LICENSE) file for more info.
--------------------------------------------------------------------------------