Closed akotorri closed 1 year ago
Hi @akotorri - I believe the issue is that in current Amplify versions, only the first redirect URI is considered when using Hosted UI. In your case, that is a localhost
address which cannot be used on mobile devices. You can try moving your myapp
URI to the front of the list, which should resolve the issue.
Alternatively, please feel free to check out our vNext which is currently in dev-preview but properly handles this situation:
dependencies:
amplify_auth_cognito: ^1.0.0-0
amplify_authenticator: ^1.0.0-0
amplify_flutter: ^1.0.0-0
@dnys1 thank you for the reply, just wanted to let you know that I did upgrade my dependencies to 1.0.0-0 and it fixed the issue with google auth and it also fixed the costume authentication that previously didn’t work for me as well, thank you 😊.
Description
I'm using an existing userPool which works perfectly on the web app which was made with a different technology and for flutter I'm importing that userPool and adding the plugin in "main.dart" as we should, then call the signInWithWebUI method and provide the "AuthProvider.google" but when I do so "signInWithWebUI()" returns "An error was encountered with the requested page" and not the google auth UI,
Categories
Steps to Reproduce
Import a working userPool with a different app, add the auth plugin on main.dart try to call the singInWithWebUI
Screenshots
Platforms
Android Device/Emulator API Level
API 29, API 30
Environment
Dependencies
Device
N/A
OS
N/A
Deployment Method
Amplify CLI
CLI Version
10.0.0
Additional Context
No response
Amplify Config
const amplifyconfig = ''' { "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId": "-------", "Region": "us-east-1" } } }, "CognitoUserPool": { "Default": { "PoolId": "-------", "AppClientId": "-------", "Region": "us-east-1" } }, "Auth": { "Default": { "OAuth": { "WebDomain": "-------.auth.us-east-1.amazoncognito.com", "AppClientId": "-------", "SignInRedirectURI": "http://localhost:4200/auth,https://-------.net/auth,myapp://", "SignOutRedirectURI": "http://localhost:4200/auth,https://-------.net/auth,myapp://", "Scopes": [ "aws.cognito.signin.user.admin", "email", "openid", "profile" ] }, "authenticationFlowType": "CUSTOM_AUTH", "socialProviders": [ "GOOGLE" ], "usernameAttributes": [ "EMAIL" ], "signupAttributes": [ "NAME", "EMAIL" ], "passwordProtectionSettings": { "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [] }, "mfaConfiguration": "OFF", "mfaTypes": [], "verificationMechanisms": [] } }, "S3TransferUtility": { "Default": { "Bucket": "-------", "Region": "us-east-2" } } } } }, "storage": { "plugins": { "awsS3StoragePlugin": { "bucket": "-------", "region": "us-east-2", "defaultAccessLevel": "guest" } } } }''';