auth0 / Xamarin.Auth0Client

This library has been deprecated. See README for more info
MIT License
22 stars 41 forks source link

Xamarin.Forms implementation #22

Closed theobouwman closed 7 years ago

theobouwman commented 8 years ago

Hello,

At first I want to mention that I'm new to Xamarin and Auth0.

I've tried to implement the Xamarin.Auth0Client in a Forms application, but I can't even install the package via NuGet. I'm getting this error:

Could not install package 'Auth0.Core 3.3.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

And then there is also no tutorial/ guide to implement Auth0 in a Xamarin.Forms application.

I hope that this is enough information to help me.

Thanks in advance,

Theo

jerriep commented 8 years ago

Hi Theo,

We support PCL Profile 111 (.NET 4.5, Windows 8.0, Windows Phone 8.1) (netstandard 1.1)

Can you possibly try and switch to that?

I will look into this in the meantime and see if we can support Profile 259, but no promises on that

jerriep commented 8 years ago

@theobouwman Which NuGet package did you try and install? What is the name of the package?

The package I referred to about is the Auth0.Core package, but I cannot see that the Xamarin component takes any dependency on that.

To install the Xamarin component, you need to add it via the Components. Please see https://auth0.com/docs/quickstart/native/xamarin

ChaseFlorell commented 7 years ago

I'm looking for this as well. Would be willing to work on a PR if it's something you'd accept.

AntRemo commented 7 years ago

+1 Looking for this :)

dagostinelli commented 7 years ago

@theobouwman I think the problem here is that you may have the wrong NuGet package installed. I'm new to Auth0 as well. I think you have to install a different package -- Instead of 'Auth0.Core 3.3.0', it should be 'Auth0.OidcClient.Android'

I've filed an issue about the confusing NuGet situation in this issue

I wish there was a better sample for Xamarin Forms. I filed a request in this other issue

ChaseFlorell commented 7 years ago

Not to hijack this thread, but I am working on a new version (from scratch) that's fully portable and therefore doesn't need Android/iOS dlls.

It's sorta rough right now but feel free to take a peek, send a PR, or do whatever you want. It has both an Auth0Client as well as an Auth0ManagementClient.

I did rip off a little bit of code out of this library for validating a Token

https://github.com/ChaseFlorell/Auth0

jerriep commented 7 years ago

There is no immediate plan to support Xamarin Forms.

If a sample of using Xamarin Forms is made by someone from the community, we will gladly include this in the Xamarin Samples repo

@ChaseFlorell A lot of the things you seem to be doing is supported in the Auth0.NET library. This is a .NET Standard 1.3 library and contains wrappers around both the Management and Authentication APIs

ChaseFlorell commented 7 years ago

@jerriep well why are the libraries so fragmented? It really doesn't seem to be all that clear as to which we're supposed to be using, and really, if you're just calling an API, there's no reason why it can't be fully portable (standard). I'm glad to see that there's an Auth0.NET library and since it's .NET Standard 1.3, there's really no reason you can't point Xamarin users to that.

I began working on my own because the Xamarin one listed/provided is really quite awful. Why not deprecate it in favour of the other?

jerriep commented 7 years ago

@ChaseFlorell It depends on what you want to do.

If you want to add authentication to your app, you cannot just simply use the Authentication API. You will need to handle the browser interaction of sending the user to the /authorize endpoint, and also handle the callback

This is what the Auth0 OIDC Client is for, and this is described in the Xamarin Quickstart

For any other low level access to the Authentication API or the Management API, you should be using the Auth0.NET SDK

jerriep commented 7 years ago

This library is deprecated and replaced with the Auth0 OIDC Client

Xamarin Forms issue is at https://github.com/auth0-community/auth0-xamarin-oidc-samples/issues/6

jerriep commented 6 years ago

@theobouwman @ChaseFlorell @AntRemo @dagostinelli Are any of you still interested in Xamarin Forms support? I have something ready, and would like someone to play around with it. Please let me know and I can get you set up with the beta versions of the packages

dagostinelli commented 6 years ago

@jerriep I had to move on for my project. We aren't using Auth0 anymore or Xamarin Forms anymore. I appreciate being asked though. Thank you!

mdf3039 commented 6 years ago

@theobouwman @ChaseFlorell @AntRemo @dagostinelli Are any of you still interested in Xamarin Forms support? I have something ready, and would like someone to play around with it. Please let me know and I can get you set up with the beta versions of the packages

@jerriep I am interested. Using Xamarin Forms and Auth0 at the moment.