auth0-samples / auth0-xamarin-oidc-samples

Auth0 OIDC Client with Xamarin applications
MIT License
30 stars 38 forks source link

Xamarin.Forms .NET Standard #11

Closed luminousAvocado closed 6 years ago

luminousAvocado commented 6 years ago

Hello, the sample Xamarin.Forms project uses Shared Project, is there an example that uses .NET Standard? Thank you

jerriep commented 6 years ago

Not yet. You will need to use Dependency Injection. Please read this issue from this point forward: https://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6#issuecomment-380668088

One of the other users commented on how they resolved this using DI.

luminousAvocado commented 6 years ago

Apologies in advance, I'm still a student and still learning. I dont suppose you have one, but if anyone has an example using Dependency Injection, i would be forever grateful!

jerriep commented 6 years ago

No, as indicated before, we do not yet have an example of this. It is on the list to do, but I am not sure when this will be done.

jerriep commented 6 years ago

@luminousAvocado I will work on putting together a sample sometime over the next week.

In the meantime, you can also have a look at this recent blog post which demonstrates this: https://auth0.com/blog/developing-mobile-apps-with-xamarin-forms-and-azure-functions/

Also, here is the source code for that Xamarin Forms app on GH: https://github.com/Daniel-Krzyczkowski/Xamarin/tree/master/XamarinForms/Auth0XamarinForms

luminousAvocado commented 6 years ago

@jerriep that would be amazing! The provided links were also very helpful, thanks for that. Quick question, does auth0client for android launch a "custom tab" or a "webview" when showing the login?

jerriep commented 6 years ago

It launches the system browser

https://github.com/auth0/auth0-oidc-client-net/blob/db8442844e6f43d489306523cfa5d95990e0fa4c/src/Auth0.OidcClient.Android/PlatformWebView.cs#L51-L56

jerriep commented 6 years ago

@luminousAvocado Please refer to the sample which I have added for you: https://github.com/auth0-community/auth0-xamarin-oidc-samples/tree/master/Samples/Forms_NS

luminousAvocado commented 6 years ago

Thank you so much @jerriep !

luminousAvocado commented 6 years ago

Are we able to do Logout through Xamarin.Forms? Or does saving a session and logging out of a session have to be done through each platform separately? I've been referring to this: https://auth0.com/docs/logout#set-the-allowed-logout-urls-at-the-tenant-level

jerriep commented 6 years ago

This library currently has no support for logout.