feat(samples): React Native mobile login + token refresh#50
Merged
Conversation
Adds the first mobile framework to the quickstart samples — two scenarios under app_type=mobile_desktop using react-native-app-auth: PKCE login and refresh-token continuation backed by react-native-keychain. Welcome message decoded from the ID token, expiration formatted in local time, login-pkce auto-flips to "Session expired" when the access token elapses, token-refresh auto-rotates via the refresh token. Snippet tooling extended for the new framework via additions to placeholder-map.yaml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds the first mobile_desktop samples to the repo by introducing React Native implementations for PKCE login and refresh-token–based silent refresh, and wires them into the snippet extraction/manifest tooling so they appear as first-class scenarios alongside existing SPA/server samples.
Changes:
- Adds
mobile_login_pkceandmobile_token_refreshscenarios for the newreact-nativeframework in the snippet manifest + generatedsnippets.json. - Introduces two full React Native sample apps (
samples/react-native/login-pkceandsamples/react-native/token-refresh) with iOS + Android native projects. - Extends placeholder mapping and snippet extraction to support RN env access patterns and install command generation.
Reviewed changes
Copilot reviewed 76 out of 105 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| snippets.json | Adds generated snippet steps/metadata for the two new React Native mobile scenarios. |
| snippet-manifest.yaml | Registers react-native framework and adds two mobile_desktop scenarios. |
| scripts/extract-snippets.ts | Treats react-native as a “framework dependency” to exclude from install command generation. |
| placeholder-map.yaml | Adds placeholder replacements for react-native-config access patterns (Config.*!). |
| README.md | Updates repo structure docs to include the new React Native samples folder. |
| .gitignore | Adds common iOS/Android/RN build artifact ignores (Pods, Gradle, jsbundle, etc.). |
| samples/react-native/manifest.yaml | Defines the React Native framework manifest and scenario metadata. |
| samples/react-native/login-pkce/tsconfig.json | TypeScript config for the PKCE login sample. |
| samples/react-native/login-pkce/package.json | RN PKCE login sample dependencies/scripts/tooling versions. |
| samples/react-native/login-pkce/metro.config.js | Metro bundler configuration for PKCE login sample. |
| samples/react-native/login-pkce/ios/Quickstart/Quickstart-Bridging-Header.h | Adds RNAppAuth flow manager bridge header import. |
| samples/react-native/login-pkce/ios/Quickstart/PrivacyInfo.xcprivacy | iOS privacy manifest for the sample app. |
| samples/react-native/login-pkce/ios/Quickstart/LaunchScreen.storyboard | iOS launch screen for the sample app. |
| samples/react-native/login-pkce/ios/Quickstart/Info.plist | iOS bundle settings + URL scheme registration for OAuth redirect. |
| samples/react-native/login-pkce/ios/Quickstart/Images.xcassets/Contents.json | iOS asset catalog metadata. |
| samples/react-native/login-pkce/ios/Quickstart/Images.xcassets/AppIcon.appiconset/Contents.json | iOS app icon asset catalog metadata. |
| samples/react-native/login-pkce/ios/Quickstart/AppDelegate.swift | Implements RNAppAuthAuthorizationFlowManager + RN app bootstrap. |
| samples/react-native/login-pkce/ios/Quickstart.xcodeproj/xcshareddata/xcschemes/Quickstart.xcscheme | Shares Xcode scheme for the sample. |
| samples/react-native/login-pkce/ios/Podfile | CocoaPods setup for the iOS project. |
| samples/react-native/login-pkce/ios/.xcode.env | Xcode script-phase Node binary environment config. |
| samples/react-native/login-pkce/index.js | RN entry point registering the root component. |
| samples/react-native/login-pkce/babel.config.js | Babel preset configuration for RN. |
| samples/react-native/login-pkce/app.json | RN app name/displayName. |
| samples/react-native/login-pkce/android/settings.gradle | Android Gradle settings and RN autolinking config. |
| samples/react-native/login-pkce/android/gradlew.bat | Windows Gradle wrapper script for Android project. |
| samples/react-native/login-pkce/android/gradlew | POSIX Gradle wrapper script for Android project. |
| samples/react-native/login-pkce/android/gradle/wrapper/gradle-wrapper.properties | Gradle distribution pinning for Android build. |
| samples/react-native/login-pkce/android/gradle.properties | Android/Gradle build properties (Hermes, new arch, etc.). |
| samples/react-native/login-pkce/android/build.gradle | Root Android buildscript + toolchain versions. |
| samples/react-native/login-pkce/android/app/src/main/res/values/styles.xml | Android theme/style resources. |
| samples/react-native/login-pkce/android/app/src/main/res/values/strings.xml | Android string resources (app name). |
| samples/react-native/login-pkce/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Android launcher icon asset (xxhdpi). |
| samples/react-native/login-pkce/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png | Android round launcher icon asset (xhdpi). |
| samples/react-native/login-pkce/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png | Android launcher icon asset (xhdpi). |
| samples/react-native/login-pkce/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png | Android round launcher icon asset (mdpi). |
| samples/react-native/login-pkce/android/app/src/main/res/mipmap-mdpi/ic_launcher.png | Android launcher icon asset (mdpi). |
| samples/react-native/login-pkce/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png | Android round launcher icon asset (hdpi). |
| samples/react-native/login-pkce/android/app/src/main/res/mipmap-hdpi/ic_launcher.png | Android launcher icon asset (hdpi). |
| samples/react-native/login-pkce/android/app/src/main/res/drawable/rn_edit_text_material.xml | Android drawable workaround for RN EditText background NPE. |
| samples/react-native/login-pkce/android/app/src/main/java/com/secureauth/quickstart/MainApplication.kt | Android Application wiring for React Native host. |
| samples/react-native/login-pkce/android/app/src/main/java/com/secureauth/quickstart/MainActivity.kt | Android Activity wiring for RN app component. |
| samples/react-native/login-pkce/android/app/src/main/AndroidManifest.xml | Android manifest incl. permissions and main activity. |
| samples/react-native/login-pkce/android/app/proguard-rules.pro | ProGuard rules placeholder for the sample. |
| samples/react-native/login-pkce/android/app/build.gradle | Android app module build config + AppAuth redirect scheme placeholder. |
| samples/react-native/login-pkce/README.md | Documentation for running and configuring PKCE login sample. |
| samples/react-native/login-pkce/App.tsx | Implements system-browser PKCE login + best-effort revoke logout + expiry UI. |
| samples/react-native/login-pkce/.yarnrc.yml | Yarn config (node-modules linker + pinned Yarn path). |
| samples/react-native/login-pkce/.env.example | Example env variables for RN config (ISSUER_URL, CLIENT_ID, etc.). |
| samples/react-native/token-refresh/tsconfig.json | TypeScript config for refresh-token sample. |
| samples/react-native/token-refresh/package.json | RN token refresh sample deps/scripts (adds react-native-keychain). |
| samples/react-native/token-refresh/metro.config.js | Metro bundler configuration for token refresh sample. |
| samples/react-native/token-refresh/ios/Quickstart/Quickstart-Bridging-Header.h | Adds RNAppAuth flow manager bridge header import. |
| samples/react-native/token-refresh/ios/Quickstart/PrivacyInfo.xcprivacy | iOS privacy manifest for the sample app. |
| samples/react-native/token-refresh/ios/Quickstart/LaunchScreen.storyboard | iOS launch screen for the sample app. |
| samples/react-native/token-refresh/ios/Quickstart/Info.plist | iOS bundle settings + URL scheme registration for OAuth redirect. |
| samples/react-native/token-refresh/ios/Quickstart/Images.xcassets/Contents.json | iOS asset catalog metadata. |
| samples/react-native/token-refresh/ios/Quickstart/Images.xcassets/AppIcon.appiconset/Contents.json | iOS app icon asset catalog metadata. |
| samples/react-native/token-refresh/ios/Quickstart/AppDelegate.swift | Implements RNAppAuthAuthorizationFlowManager + RN app bootstrap. |
| samples/react-native/token-refresh/ios/Quickstart.xcodeproj/xcshareddata/xcschemes/Quickstart.xcscheme | Shares Xcode scheme for the sample. |
| samples/react-native/token-refresh/ios/Podfile | CocoaPods setup for the iOS project. |
| samples/react-native/token-refresh/ios/.xcode.env | Xcode script-phase Node binary environment config. |
| samples/react-native/token-refresh/index.js | RN entry point registering the root component. |
| samples/react-native/token-refresh/babel.config.js | Babel preset configuration for RN. |
| samples/react-native/token-refresh/app.json | RN app name/displayName. |
| samples/react-native/token-refresh/android/settings.gradle | Android Gradle settings and RN autolinking config. |
| samples/react-native/token-refresh/android/gradlew.bat | Windows Gradle wrapper script for Android project. |
| samples/react-native/token-refresh/android/gradlew | POSIX Gradle wrapper script for Android project. |
| samples/react-native/token-refresh/android/gradle/wrapper/gradle-wrapper.properties | Gradle distribution pinning for Android build. |
| samples/react-native/token-refresh/android/gradle.properties | Android/Gradle build properties (Hermes, new arch, etc.). |
| samples/react-native/token-refresh/android/build.gradle | Root Android buildscript + toolchain versions. |
| samples/react-native/token-refresh/android/app/src/main/res/values/styles.xml | Android theme/style resources. |
| samples/react-native/token-refresh/android/app/src/main/res/values/strings.xml | Android string resources (app name). |
| samples/react-native/token-refresh/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Android launcher icon asset (xxhdpi). |
| samples/react-native/token-refresh/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png | Android round launcher icon asset (xhdpi). |
| samples/react-native/token-refresh/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png | Android launcher icon asset (xhdpi). |
| samples/react-native/token-refresh/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png | Android round launcher icon asset (mdpi). |
| samples/react-native/token-refresh/android/app/src/main/res/mipmap-mdpi/ic_launcher.png | Android launcher icon asset (mdpi). |
| samples/react-native/token-refresh/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png | Android round launcher icon asset (hdpi). |
| samples/react-native/token-refresh/android/app/src/main/res/mipmap-hdpi/ic_launcher.png | Android launcher icon asset (hdpi). |
| samples/react-native/token-refresh/android/app/src/main/res/drawable/rn_edit_text_material.xml | Android drawable workaround for RN EditText background NPE. |
| samples/react-native/token-refresh/android/app/src/main/java/com/secureauth/quickstart/MainApplication.kt | Android Application wiring for React Native host. |
| samples/react-native/token-refresh/android/app/src/main/java/com/secureauth/quickstart/MainActivity.kt | Android Activity wiring for RN app component. |
| samples/react-native/token-refresh/android/app/src/main/AndroidManifest.xml | Android manifest incl. permissions and main activity. |
| samples/react-native/token-refresh/android/app/proguard-rules.pro | ProGuard rules placeholder for the sample. |
| samples/react-native/token-refresh/android/app/build.gradle | Android app module build config + AppAuth redirect scheme placeholder. |
| samples/react-native/token-refresh/README.md | Documentation for running and configuring refresh-token sample. |
| samples/react-native/token-refresh/App.tsx | Implements refresh token persistence + silent refresh + auto-refresh scheduling + revoke logout. |
| samples/react-native/token-refresh/.yarnrc.yml | Yarn config (node-modules linker + pinned Yarn path). |
| samples/react-native/token-refresh/.env.example | Example env variables for refresh-token flow (offline_access scope). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ksroda-sa
marked this pull request as ready for review
April 30, 2026 11:55
bwereszczak
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first mobile framework — two scenarios under
app_type=mobile_desktopusingreact-native-app-auth:mobile_login_pkce: system-browser PKCE login, welcome banner from ID-token claims, "Session expired" auto-flip when access token elapses, sign-out viarevoke().mobile_token_refresh:offline_accessflow, refresh token persisted inreact-native-keychain, silent refresh on app launch + auto-refresh timer + manual refresh button.Both samples bundle iOS (Xcode workspace + AppAuth-iOS via CocoaPods) and Android (Gradle + AppAuth-Android) project trees, hand-authored AppDelegate conforming to
RNAppAuthAuthorizationFlowManager, andConfig.*!env-loading fromreact-native-configwith placeholder-map entries appended to the existingjs:section.Why
First mobile framework in the 5-plan rollout for adding
app_type=mobile_desktopquickstart samples. Picks RN first because it slots into the existingtest-js.ymlmatrix viabuild:ci(tsc --noEmit).🤖 Generated with Claude Code