await authorize(config) never returns
See original GitHub issueHi all, I tried to use the library to auth with my google youtube account, I like to query my youtube videos after login and getting access token from the returned userInfo fo authorize() function, but the result is:
- My app asked to select email,
- After I selected email, it showed the google home page with my email icon on the right corner.
- the function call const result = await authorize(config); never returned
- I have nowhere to get my access token since nothing returned.
My code is as following, so where did I do wrong?
Thanks
`
const config = {
issuer: 'https://accounts.google.com',
clientId: 'xxx29l52.apps.googleusercontent.com',//it is not my real clientId, but used my real clientId for testing
redirectUrl: 'com.googleusercontent.apps.xxx29l52:/oauth2redirect',
scopes: ['https://www.googleapis.com/auth/youtube.readonly']
};
console.log("auth config: ",config);
try {
const result = await authorize(config);
console.log("auth result: ",result);
} catch (error) {
console.log("auth error: ", error);
}
`
Environment
System: OS: macOS 10.14.6 CPU: (8) x64 Intel® Core™ i7-7820HQ CPU @ 2.90GHz Memory: 300.06 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.4.0 - /usr/local/bin/node npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0 Android SDK: API Levels: 23, 25, 26, 27, 28 Build Tools: 27.0.3, 28.0.2, 28.0.3 System Images: android-22 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.1 AI-173.4907809 Xcode: 11.1/11A1027 - /usr/bin/xcodebuild npmPackages: react: ^16.8.6 => 16.8.6 react-native: ^0.60.0 => 0.60.0 npmGlobalPackages: react-native-asset: 2.0.0 react-native-cli: 2.0.1 react-native-cn-richtext-editor: 1.0.33 react-native-git-upgrade: 0.2.7
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (1 by maintainers)
Top GitHub Comments
@here I’ve just had the same issue with react-native-app-auth@4.4.0 on Android only (iOS was fine).
The configuration used to work for a long time and suddenly on a recent build it started to fail systematically.
I could solve the issue by:
additionalParameters: {…}
}; and adding this in android/app/build.grade defaultConfig { … manifestPlaceholders = [ appAuthRedirectScheme: ‘com.domain.application’ ] }
Issue is still found by following the naming convention of the redirect url (i.e. com.domain.application://oauth2/authorize)