I know this should be trivial, but I haven't found a working example of loggin in using facebook or google for Xamarin Forms using Xamarin.Auth
Can anyone share a working project or point me to a repository with a working example?
OK. Found a solution. https://github.com/HoussemDellai/Facebook-Login-Xamarin-Forms
Basically, you create a webview and hookup the Navigated event.
I use the same example, but I could not figure out how to close the session. You did?
Another related question - (somewhat off topic, but still related).
I am having some issues understanding the flow of Oauth2 with a mobile app.
With web app, it is pretty clear that the redirect URI gets the proper code and the app takes it from there.
However, how is this done with a mobile app ? Does it poll the server until something changes? What about mobile apps that don't even have a server, but still need authentication?
Can't you just navigate to the logout ?
Maybe try these options:
I already tried those options but I did not work. The problem lies in the WebView that stores the cookies of the session and the only thing that can be achieved is to eliminate the token but not change of user.
Given the urgency, look for another solution. And finally I found this:https://github.com/AlejandroRuiz/XamarinFormsFacebook/tree/master/XamarinFormsFacebook
Only works on Android and iOS. If you do not actually require Windows Phone, opt for this.
It is complicated to set up, but once done the results are very good. If you have a problem you can guide the video:
I tell you, there is another problem with logging in from the webview that you have not considered, you can see the error and the solution here:
I tried all the settings and follow the Sample https://developer.xamarin.com/samples/xamarin-forms/WebServices/OAuthNativeFlow/ and guidelines https://developer.xamarin.com/guides/xamarin-forms/cloud-services/authentication/oauth/.
Its working fine with the sample with all settings related to my app. But when i integrated same things in my existing app, it does not work on Android(On iOS it works fine without any issue). On Android it come back to my app from google sign in screen, but the values are blank(meaning no email or given name or family name from google). Also my OnAuthCompleted is never called. There are no errors in application output.
So i am confused that what could be the wrong thing?
I have button in a Main.xaml xamarin forms application
When click on button, I need to get the google login, I am using above urls, Those are implemented ui design in native platforms. Is there any way to get login using common ui of xamarinforms?
Please help me out ...Thanks in advance......
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies