Skip to content

feat(samples): React Native mobile login + token refresh#50

Merged
ksroda-sa merged 10 commits into
mainfrom
feature/react-native-mobile-samples
May 4, 2026
Merged

feat(samples): React Native mobile login + token refresh#50
ksroda-sa merged 10 commits into
mainfrom
feature/react-native-mobile-samples

Conversation

@ksroda-sa

@ksroda-sa ksroda-sa commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the first mobile framework — two scenarios under app_type=mobile_desktop using react-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 via revoke().
  • mobile_token_refresh: offline_access flow, refresh token persisted in react-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, and Config.*! env-loading from react-native-config with placeholder-map entries appended to the existing js: section.

Why

First mobile framework in the 5-plan rollout for adding app_type=mobile_desktop quickstart samples. Picks RN first because it slots into the existing test-js.yml matrix via build:ci (tsc --noEmit).

🤖 Generated with Claude Code

ksroda-sa and others added 2 commits April 30, 2026 10:53
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>
Base automatically changed from feature/mobile-foundation to main April 30, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_pkce and mobile_token_refresh scenarios for the new react-native framework in the snippet manifest + generated snippets.json.
  • Introduces two full React Native sample apps (samples/react-native/login-pkce and samples/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.

Comment thread samples/react-native/login-pkce/ios/Quickstart/Info.plist Outdated
Comment thread samples/react-native/token-refresh/App.tsx
Comment thread samples/react-native/token-refresh/ios/Quickstart/Info.plist Outdated
Comment thread samples/react-native/login-pkce/App.tsx Outdated
@ksroda-sa
ksroda-sa marked this pull request as ready for review April 30, 2026 11:55
@ksroda-sa
ksroda-sa requested a review from a team as a code owner May 4, 2026 11:38
@ksroda-sa
ksroda-sa requested a review from bwereszczak May 4, 2026 11:47
@ksroda-sa
ksroda-sa merged commit 62f960a into main May 4, 2026
19 checks passed
@ksroda-sa
ksroda-sa deleted the feature/react-native-mobile-samples branch May 4, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants