We are very excited to announce the release of the Auth0 Component for Xamarin. As with the other SDKs we released (and available on Github), its goal is to streamline authentication with any of our supported identity providers. Consumer or Enterprise.
The API is straight forward and very easy to use. It works with iOS and Android:
var auth0 = new Auth0Client( "{subDomain}", "{clientID}", "{clientSecret}"); auth0.LoginAsync (this) .ContinueWith(t => { var facebook_token = t.Result.Profile["identities"][0]["access_token"]; var email = t.Result.Profile["email"].ToString(); });
The code above will display the Auth0 login widget as seen in the picture above.
It is delivered as a component, so you can get it straight into Xamarin Studio.
What you get back after login is the normalized user profile and Json Web Token you can use to authenticate calls with your API.
Here's a quick end to end demo (use full screen):
Last but not least, if you have Windows Azure Mobile Services enabled in Auth0, then you can use the token to call WAMS endpoints with no changes or additional code. Auth0 will generate the right JWT for you.
We want to thank the folks at Xamarin for their support and great experience!
The sample image was generated with the awesome placeit.