reverted?

This commit is contained in:
bobbert committed 2026-02-24 21:16:29 +00:00
1 parent 974427e316
commit 73566647ea
4 files changed
+85 -14

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
# Google OAuth Setup for Android APK
## Step 1: Create a Google Cloud Project
1. Go to https://console.cloud.google.com/
2. Click **Select a project** → **New Project**
3. Name it and click **Create**
## Step 2: Enable the Photos Library API
1. Go to **APIs & Services** → **Library**
2. Search for **Photos Library API** → Enable it
## Step 3: Configure the OAuth Consent Screen
1. Go to **APIs & Services** → **OAuth consent screen**
2. Choose **External** → **Create**
3. Fill in:
- **App name**: MASS Photo App
- **User support email**: your email
- **Developer contact**: your email
4. **Scopes** → Add or Remove Scopes:
- `openid`
- `https://www.googleapis.com/auth/photoslibrary`
- `https://www.googleapis.com/auth/photoslibrary.appendonly`
- `https://www.googleapis.com/auth/userinfo.email`
- `https://www.googleapis.com/auth/userinfo.profile`
5. **Test users** → Add your Google account email address
## Step 4: Create an Android OAuth Client ID
1. Go to **APIs & Services** → **Credentials**
2. **+ Create Credentials** → **OAuth client ID**
3. Application type: **Android**
4. Package name: `com.bobthebob.massphotoapp`
5. SHA-1 certificate fingerprint: get it by running `eas credentials --platform android`
6. Click **Create** and copy the **Client ID**
7. Open `src/AUTH/GoogleAUTH.js` and set `ANDROID_CLIENT_ID` to the copied value
## How it works
- The **Android client ID** is used for both the authorization request and the
token exchange. Google verifies the request using the app's package name +
SHA-1 signing certificate, so no redirect URI registration is needed.
- The redirect goes to `com.bobthebob.massphotoapp:/oauthredirect` which
Android routes back into the app via the intent filter in `app.json`.
- Android clients are public (no `client_secret` required). PKCE `code_verifier`
is used to secure the authorization code exchange.
## Testing the API with OAuth Playground
1. Go to https://developers.google.com/oauthplayground
2. Click the gear icon → check "Use your own OAuth credentials"
3. You will need a **Web application** client for the playground only (the
playground cannot use Android clients). Create one in the console if needed,
add `https://developers.google.com/oauthplayground` to its redirect URIs.
4. Select Photos Library API scopes and authorize
5. Copy the access token and run: `node TEST/testGooglePhotosAPI.js <TOKEN>`
+20 -10
View File
@@ -1,27 +1,37 @@
# Install Commands
## Client App (root folder)
## Client App (project root)
```bash
npm install expo expo-sqlite expo-crypto expo-secure-store expo-auth-session expo-web-browser expo-linking expo-blur expo-file-system expo-image-picker expo-media-library expo-status-bar react react-native @react-navigation/native @react-navigation/native-stack @react-navigation/bottom-tabs react-native-safe-area-context react-native-screens axios @babel/core
npx expo install expo expo-sqlite expo-crypto expo-secure-store expo-auth-session expo-web-browser expo-linking expo-blur expo-file-system expo-image-picker expo-media-library expo-status-bar react react-native react-native-reanimated react-native-gesture-handler react-native-worklets react-native-safe-area-context react-native-screens @react-navigation/native @react-navigation/native-stack @react-navigation/bottom-tabs axios @babel/core
```
## NAS Backend Server (ServerFiles folder)
## NAS Backend (ServerFiles folder)
```bash
cd ServerFiles && npm install express cors dotenv jsonwebtoken express-fileupload body-parser node-fetch@2 nodemon
cd ServerFiles && npm install && cd ..
```
## Quick Setup (both at once)
```bash
npm install && cd ServerFiles && npm install && cd ..
```
## Quick Setup
## Version Fix (if React version mismatch)
```bash
npx expo install --fix
npx expo install --fix && cd ServerFiles && npm install && cd ..
```
## Clear Cache + Rebuild
```bash
npx expo start --clear
```
## Run the NAS Backend Server
```bash
cd ServerFiles && node server.js
```
Or from the project root:
```bash
npm run backend
```