Implementing Cognito Google Authentication with AWS Amplify in Mobile Apps #13744
Closed
3 tasks done
Labels
Auth
Related to Auth components/category
question
General question
React Native
React Native related issue
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
Amplify CLI
Environment information
Describe the bug
Prerequisites:
JavaScript Framework: React Native
Backend Amplify CLI
Java Version (JDK): 17.0.11
React Native Version: ^0.72.4
Gradle Version: 8.0.1 or 8.0.2
Describe the bug:
I have installed the AWS CLI and configured AWS Amplify, as well as set up Google authentication. After running amplify push, I received the hosted UI endpoint URL in the format https://<Domain_name>/login?response_type=code&client_id=<client_id>&redirect_uri=myapp://
Upon using this hosted UI endpoint, I was able to see the Google login page.
After entering the credentials (email and password) the user is successfully login,
user registered in the backend Cognito user pool. However, after returning to the app's login screen, I want the user to be redirected to the home screen.
To achieve this, I added an intent filter in the AndroidManifest.xml file. Please let me know how to handle the redirect correctly.
and this also
Expected behavior
after user login successfully redirect to home screen
Reproduction steps
Code Snippet
Log output
aws-exports.js
const awsmobile = {
"Auth": {
"aws_project_region": "ap-south-1",
"aws_cognito_identity_pool_id": "ap-south-1xxxxxxxxxx",
"aws_cognito_region": "ap-south-1",
"aws_user_pools_id": "xxxxxxx",
"aws_user_pools_web_client_id": "xxxxxxxxx",
"oauth": {
"domain": "xxxxxx",
"scope": [
"phone",
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
],
"redirectSignIn": "myapp://", even tried the (myapp://Home)
"redirectSignOut": "myapp://", even tried the (myapp://Home)
"responseType": "code"
},
"federationTarget": "COGNITO_USER_POOLS",
"aws_cognito_username_attributes": [
"EMAIL"
],
"aws_cognito_social_providers": [
"GOOGLE"
],
"aws_cognito_signup_attributes": [
"EMAIL"
],
"aws_cognito_mfa_configuration": "OFF",
"aws_cognito_mfa_types": [
"SMS"
],
"aws_cognito_password_protection_settings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"aws_cognito_verification_mechanisms": [
"EMAIL"
]
}};
export default awsmobile;
Manual configuration
No response
Additional configuration
No response
Mobile Device
android
Mobile Operating System
No response
Mobile Browser
chrome
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: