Reference mobile App for TOTP & Push-Based Authentication#195
Reference mobile App for TOTP & Push-Based Authentication#195DilshanSenarath wants to merge 51 commits intoasgardeo:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a comprehensive React Native Expo-based authenticator application that provides TOTP (Time-based One-Time Password) and push notification authentication capabilities. The app is designed as a reference implementation for mobile authentication workflows.
- Establishes foundational project structure with TypeScript, routing, and platform configurations
- Implements core authentication features including QR code scanning, TOTP generation, and push notification handling
- Creates reusable UI components and context providers for state management
Reviewed Changes
Copilot reviewed 63 out of 66 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
samples/authenticator-app/package.json |
Defines project dependencies including Expo, React Native, crypto libraries, and Firebase messaging |
samples/authenticator-app/app.json |
Configures Expo app metadata, permissions, and platform-specific settings |
samples/authenticator-app/tsconfig.json |
Sets up TypeScript configuration with strict mode and path aliases |
samples/authenticator-app/config/app.config.json |
Provides comprehensive theme and feature configuration for light/dark modes |
samples/authenticator-app/src/utils/*.ts |
Implements utility functions for QR validation, crypto operations, storage, and UI helpers |
samples/authenticator-app/src/models/*.ts |
Defines TypeScript interfaces for storage, authentication, UI theming, and crypto operations |
samples/authenticator-app/src/contexts/*.tsx |
Creates React contexts for account management, TOTP operations, and push authentication |
samples/authenticator-app/src/components/*.tsx |
Builds reusable UI components for QR scanning, authentication flows, and account management |
samples/authenticator-app/app/*.tsx |
Implements screen components and navigation layout for the app |
pnpm-workspace.yaml |
Excludes the authenticator app from workspace build processes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
samples/authenticator-app/src/components/push-auth-history/history-card.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 64 out of 67 changed files in this pull request and generated 6 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
samples/authenticator-app/src/utils/verifyLocalAuthentication.ts
Outdated
Show resolved
Hide resolved
| * @param input - The input string to be encoded. | ||
| * @returns The Base64 URL encoded string. | ||
| */ | ||
| private static encodeBase64Url(input: string | Buffer<ArrayBuffer>): string { |
There was a problem hiding this comment.
The type 'Buffer' appears incorrect. Buffer doesn't take a generic type parameter. Should be 'string | Buffer'.
| private static encodeBase64Url(input: string | Buffer<ArrayBuffer>): string { | |
| private static encodeBase64Url(input: string | Buffer | ArrayBuffer): string { |
| borderRadius: '50%', | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| width: 'auto', | ||
| height: 'auto', | ||
| paddingVertical: 12, | ||
| paddingHorizontal: 12 |
There was a problem hiding this comment.
Using CSS string values like '50%' in React Native StyleSheet is not supported. Use numeric values or rely on the width/height to create circular shapes.
| borderRadius: '50%', | |
| alignItems: 'center', | |
| justifyContent: 'center', | |
| width: 'auto', | |
| height: 'auto', | |
| paddingVertical: 12, | |
| paddingHorizontal: 12 | |
| borderRadius: 24, | |
| alignItems: 'center', | |
| justifyContent: 'center', | |
| width: 48, | |
| height: 48, | |
| // paddingVertical and paddingHorizontal are not needed for a circular button |
| { | ||
| "devMode": { | ||
| "enabled": true, | ||
| "host": "http://10.10.16.152:8082" |
There was a problem hiding this comment.
Hardcoded IP address in configuration may expose internal network information. Consider using environment variables or placeholder values for sensitive configuration.
| "host": "http://10.10.16.152:8082" | |
| "host": "${DEV_HOST}" |
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. |
Purpose
This pull request introduces a new Expo-based authenticator app under
samples/authenticator-app. The changes lay the foundation for the app by adding configuration files, initial screens, routing, and development environment setup. The app includes basic navigation, authentication features, and platform-specific settings.Project setup and configuration:
samples/authenticator-appto the workspace, excluding it from certain build processes inpnpm-workspace.yaml.app.json.App structure and routing:
app/_layout.tsxwith stack navigation and screen configuration, using custom components and context providers.Related Issues
Related PRs
Checklist
Security checks