question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Social Federation Not Working

See original GitHub issue

Describe the bug I am unable to get the signIn method of the hub listener to fire upon signin via Auth.federatedSignin().

Expected behavior When a user signs in via Google or Facebook (i.e. Auth.federatedSignin({provider: ‘facebook/google’})) they should be redirected back to my app (e.g. customdomain.com) and the signIn method of the hub listener should fire.

**Screenshots ** Here is a log that shows what happens when I log in Auth.federatedSignin({provider: ‘google’}):

Screen Shot 2020-04-25 at 8 51 24 PM Screen Shot 2020-04-25 at 8 51 33 PM

As you can see, there are only two instances when an auth event is being dispatched, and it is only during initialization (on event parsingCallbackUrl). A subsequent auth event ‘signIn’ should be fired, but it is not.

What is Configured? I have oauth configured using @dabit3 's wonderful tutorial on social federation with amplify. I am using Cognito User Pools for authentication which allows social federation via Amazon, Google, and Facebook. I have a custom domain set up with route 53 and it has a hosted zone.

My exports file looks like the following:

const awsmobile = {
    "aws_project_region": "us-west-2",
    "aws_cognito_identity_pool_id": "us-west-2:xxx,
    "aws_cognito_region": "us-west-2",
    "aws_user_pools_id": "us-west-2_2MMItODxV",
    "aws_user_pools_web_client_id": "xxx",
    "oauth": {
        "domain": "xxx-master.auth.us-west-2.amazoncognito.com",
        "scope": [
            "phone",
            "email",
            "openid",
            "profile",
            "aws.cognito.signin.user.admin"
        ],
        "redirectSignIn": "https://mydomain.net/",
        "redirectSignOut": "https://mydomain.net/",
        "responseType": "code"
    },
    "federationTarget": "COGNITO_USER_POOLS",
    "aws_appsync_graphqlEndpoint": "https://xxx.appsync-api.us-west-2.amazonaws.com/graphql",
    "aws_appsync_region": "us-west-2",
    "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS",
    "aws_user_files_s3_bucket": "xxx-master",
    "aws_user_files_s3_bucket_region": "us-west-2"
};

Additional context When I was following the aforementioned tutorial it worked like a charm in my dev environment. However, now that I have changed the redirect urls (via the amplify cli and on the google/facebook oauth accounts) the feature does not work. In face when I sign in, the google oauth redirects to mydomain.com/#, as opposed to the expected redirect: mydomain.com/. Facebook also redirects in a strange way by forwarding to mydomain.com/#_=_, as opposed to mydomain.com/. I’m not sure if this is significant or not. As far as I can tell, the oauth providers have been set up properly (on the facebook/google dev sites). I have pasted the oauth endpoints (e.g. xxx-master.auth.com) in the correct places and I am really frustrated that I can’t get this thing to work 😕

I should also mention that this feature was working before I tried setting up my custom domain.

edit: After doing some testing I found that this feature works on my dev environment which is hosted with the amplify console. With this setup my auth resources and storage (hosting) resources match up nicely (e.g. xxx-amplifydev.auth.com & xxx-amplifydev.com). However, on my master environment the resources do not match up (e.g. mydomain.com & xxx-amplifymaster.auth.com). I have a feeling that the error lies in this discrepancy. Is there anything special I have to setup when using a custom domain and social federation?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mrichmancommented, May 17, 2020

I am experiencing the same behavior, and had to implement the hack in this issue.

2reactions
VTSinglecommented, Apr 28, 2020

same error

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Federation - VMware Docs
The following list provides a starting point for troubleshooting problems with the enterprise federation setup in the Cloud Services Console ...
Read more >
federation not working, how do i track down why? : r/PixelFed
I'm using both the browser and fedilab to post and check the pixelfed instance. I use the browser and yuito or milktea to...
Read more >
Nextcloud Social federation not working; webfinger seems OK
Since this afternoon I my Nextclouds are webfinger-enabled, and the test at webfinger.net replies with something useful.
Read more >
Lync Troubleshooting: federation not working - TechNet Articles
Try to telnet target Lync edge FQDN using 5061 port number. Test-CsFederatedPartner –Target “Lync Server Pool FQDN” –Domain “Partner Domain name ...
Read more >
Mastodon Help - Guide
Mastodon is not a social network ... It also takes some work to maintain and moderate an Instance. ... Only explorers will enlarge...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found