Skip to content

Ability to customize pop ups when calling signInWithRedirect on iOS #3410

Open
@mkrn

Description

@mkrn

Describe the bug

  1. Using withOAuth HOC and facebookSignIn flow in expo bare / react native shows alert that says "AppName Wants to Use "amazoncognito.com" to Sign In"
    The users may not be familiar with amazoncognito.com and may be confused since they chose to sign in with Facebook, not Amazon.

  2. New users need to sign in to facebook even if they're signed in to Facebook App on their iPhone. This lowers conversions since users have to enter email/password that they may not remember.

Is there any way to have permission say "use 'facebook.com'" to sign in?
Is there any way to have new users signed in if they've signed in to the Facebook app on their phone?

I'm using expo bare and already have Facebook SDK Pod, so if there's a native way to achieve Cognito+Facebook sign in please share.

To Reproduce
Steps to reproduce the behavior:

  1. Click a button with onPress action this.props.facebookSignIn

Expected behavior

  • Alert asking if user would like to sign in with "facebook.com"
  • Following screen have user signed in to facebook.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • iPhone 8 plus
  • iOS 12.2
  • react-native 0.59.5
  • aws-amplify 1.1.26
  • "aws-amplify-react-native": "2.1.10",

Additional context
Add any other context about the problem here.

Sample code


const urlOpener = async (url, redirectUrl) => {
  const { type, url: newUrl } = await WebBrowser.openAuthSessionAsync(url, redirectUrl);

  if (type === 'success') {
    await WebBrowser.dismissBrowser();

    if (Platform.OS === 'ios') {
      return Linking.openURL(newUrl);
    }
  }
};

Amplify.configure({
Auth: {
...
oauth: {
      domain: Config.REACT_APP_COGNITO_DOMAIN,
      scope: ['public_profile', 'email'],
      redirectSignIn: `app://signIn`, 
      redirectSignOut: `app://signOut`,
      responseType: 'code',
      urlOpener,
    }

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AuthRelated to Auth components/categoryReact NativeReact Native related issueUIRelated to UI Componentsfeature-requestRequest a new featurepending-maintainer-responseIssue is pending a response from the Amplify team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions