jonsaw / amazon-cognito-identity-dart

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
204 stars 93 forks source link

Adding Social Identity Providers to a User Pool #19

Open msaliminia opened 6 years ago

msaliminia commented 6 years ago

Hi,

is it possible to use social idp like google to sign in to a user pool via this SDK? https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html

jonsaw commented 6 years ago

Hi @msaliminia, technically should be possible with this SDK (but I have not tested). This package is modeled after the amazon-cognito-identity-js package. Any examples that work there will likely work here.

ncb000gt commented 5 years ago

I'll likely be trying this in the next couple months and can ping back here when I do.

BerndWessels commented 5 years ago

@jonsaw @ncb000gt Any updates on this? Seems there is no support for social providers at the moment :(

ncb000gt commented 5 years ago

@BerndWessels I still haven't gotten around to trying it out. Sorry. Too much stuff on the roadmap. :)

But, in all honesty, I'd bet that anyone using the platform I'm building would appreciate the support so I'll see about integrating a federated identities... Can't promise on timeline though. I'll see if I can get something working in a couple hours today, but may have to drop it if it's not quick to do.

pbaker5 commented 5 years ago

@ncb000gt Hey. I'm also interested in this. Have you made any progress?

ncb000gt commented 5 years ago

I wasn't able to make much progress. It seemed like the credentials class was going to need some work- specifically the logins piece seems to be mostly hard coded to a cognito specific url.

Also, it seemed like I wasn't going to be able to use this the same way I'd use amplify, so that was a bit of an issue since I'm using this to just house user accounts that can be authed against for my internal services. The API server I have validates the jet token from cognito, and this means that if I can't get a jet token for federated auth, then the federated identities won't matter. So, that was limiting. That's about where I stopped in favor of the other tasks I have to work on. :)

I can't stress enough that I didn't spend a lot of time on it and so I may have missed something and would love it if I did. Let me know if you see something.

BerndWessels commented 5 years ago

Hi @jonsaw @ncb000gt

I've got the federated identities to work with minimal changes. Please checkout my pull requests.

Here is an example how to use Google and Facebook to login with AWS Cognito using amazon-cognito-identity-dart and my PR - works perfectly for me now.

If anybody struggles with configuring Google and Facebook SignIn and Cognito let me know and I write up a little Medium blog with details.

Awesome work guys, finally AWS support for Flutter, love it.

ncb000gt commented 5 years ago

@BerndWessels That looks awesome. I'll see about implementing it in my project this weekend. Thanks!

ncb000gt commented 5 years ago

@BerndWessels turns out it wasn't going to work for me right now anyway because i'm not using api gateway yet. But, as I mentioned on the pr, I was expecting that was what was necessary to get this to work in general. Great job!

BerndWessels commented 5 years ago

@ncb000gt @jonsaw Works for me on Android and IOS - please consider the open PRs.

I've also published a Medium Article that explains how to use amazon-cognito-identity-dart with Google and Facebook Sign In.

ncb000gt commented 5 years ago

@BerndWessels I took a look and it looked like I'd expected. I can't test since my use case is just slightly different, but I looked at it and it LGTM. However, I am only a contributor so the most I can do is +1.

Side note, thanks for the medium article!

abbasidaniyal commented 5 years ago

@jonsaw please merge