FormidableLabs / FormidableLabs/react-native-app-auth
Google error 401 - The server cannot process the request because it is malformed. It should not be retried.
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 2.3k
- Forks
- 473
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Google 401 Malformed Request on Android when adding new account (Cognito + Google Sync)
Description
I'm experiencing a 401 Malformed Request error specifically on Android when using AWS Cognito as an Identity Provider with Google.
The issue occurs only when the device has Google account synchronization active and the user attempts to add a new Google account during the sign-in process.
Steps to Reproduce
- Trigger the login flow using
authorizewith Google/Cognito. - When the Google account selector appears, instead of picking an existing account, select "Add another account".
- Complete the Android system's native verification (fingerprint/PIN).
- Enter the new account credentials.
- The Android system displays a native "Terms and Conditions" / "Google Play Services" acceptance screen.
- After accepting, instead of redirecting back to the app/Cognito, the browser displays a Google 401 error.
Observations
- The issue does not happen if an existing account from the list is selected.
- The issue does not happen on iOS.
- Other providers (Microsoft, Apple) work perfectly.
- The redirected URL in the browser shows
authuser=unknown, suggesting the session context is lost when the Android System Assistant takes over the UI focus.
Error URL (Redacted)
https://accounts.google.com/signin/oauth/consent?authuser=unknown&part=...&flowName=GeneralOAuthFlow&client_id=REDACTED.apps.googleusercontent.com&requestPath=%2Fsignin%2Foauth%2Fconsent#
Code Snippet
const socialConfig = {
serviceConfiguration: {
authorizationEndpoint: `https://${COGNITO_URL}/oauth2/authorize`,
tokenEndpoint: `https://${COGNITO_URL}/oauth2/token`,
},
clientId: CLIENT_ID,
redirectUrl: REDIRECT_URL,
scopes: ['email', 'openid', 'profile'],
additionalParameters: {
identity_provider: 'Google',
prompt: 'select_account',
},
usePKCE: true,
};
const result = await authorize(socialConfig);
Environment
- Identity Provider:
Cognito - Platform experiencing the issue on:
Android - React Native Version:
0.83.1 - react-native-app-auth Version:
8.1.0 - Platform: Android (tested on API 36)
- Device: Physical device with Google Sync active.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el flujo de autorización y la socialConfig proporcionada, especialmente con el endpoint de autorización de Cognito, Google identity_provider y la configuración de prompt. Reprodúcelo en un dispositivo Android API 36 físico con Google Sync activo, seleccionando “Add another account” y aceptando los términos nativos de Google Play Services. Se considera completado cuando el flujo vuelve a la aplicación/Cognito en lugar de mostrar la página de Google 401 de solicitud mal formada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, react-native
- Área
- authentication, mobile
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100