Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support authentication on .NET Framework application #4

Open
Krutonium opened this issue Nov 18, 2016 · 13 comments
Open

Support authentication on .NET Framework application #4

Krutonium opened this issue Nov 18, 2016 · 13 comments

Comments

@Krutonium
Copy link

This package requires .Net below 4.5, but the other package requires 4.5 to function, as far as I can tell - Am I doing something horrendously wrong?

@Odonno
Copy link
Collaborator

Odonno commented Nov 18, 2016

Indeed, I am unable to install gitter-api-pcl nuget package on a Windows 10 Application.

What type of project are you working on ? I suppose it's a target compatibility issue.

@Odonno
Copy link
Collaborator

Odonno commented Nov 18, 2016

Ok, I found the issue. On a W10 App, you need to install first Microsoft.NET.Http package. The dependency is set for W8.1, WP8.1 but not for W10. I am sorry. I'll fix it asap.

@Krutonium
Copy link
Author

Krutonium commented Nov 18, 2016 via email

@Odonno
Copy link
Collaborator

Odonno commented Nov 19, 2016

Hi @PFCKrutonium

I may have misunderstood your problem. Are you trying to install gitter-api-auth inside a .NET framework application (like WinForms or WPF) ? If that's the case, it is normal that you can't install the package because the only platforms supported by this package are Windows 8.1 and Windows Phone 8.1 store apps (Windows 10 store apps also supported).

@Krutonium
Copy link
Author

Krutonium commented Nov 19, 2016

I'm actually trying to use it in a C# console application. How do I set all this up if I cant use this?

@Odonno
Copy link
Collaborator

Odonno commented Nov 20, 2016

Well, it depends on what you want. If you want to try the API for yourself, you can request an authorization token from https://developer.gitter.im/docs/

If you want any user to use your console application, you have to create an OAuth login process. I don't know if it's possible because to do that you have to open a webview. If that's what you need, I will try to find a solution.

@Odonno Odonno changed the title Unable to use with gitter-api-pcl Support authentication on .NET Framework application Nov 20, 2016
@Odonno
Copy link
Collaborator

Odonno commented Nov 20, 2016

@PFCKrutonium That should be done. Can you try the 0.1.4 package and tell me if that works for you ?

The package now works for .NET Framework 4.5 and later. Moreover, you can look at the source code and see that a new sample project has been created, it shows you how to use the package with a C# Console Application.

@Odonno
Copy link
Collaborator

Odonno commented Nov 22, 2016

@PFCKrutonium Any news ?

@Krutonium
Copy link
Author

Krutonium commented Nov 23, 2016

Sorry, got pulled away for other things - I'll give it a shot in a couple of hours! Will update with news.

@Krutonium
Copy link
Author

I tried to copy your example, but I ended up with this:
screenshot 80
(After I logged in)

Any ideas?

@Krutonium
Copy link
Author

Krutonium commented Nov 23, 2016

Well I fixed that (New OAuth stuff with the Redirect URI set to http://localhost), but it never returns the token. In fact, it just does this. (It does ask me if I want to allow access, of course.)
screenshot 81

@Odonno
Copy link
Collaborator

Odonno commented Nov 23, 2016

@PFCKrutonium Oh, that's not good. I tried it many times and everything works fine. The redirect URI should be http://localhost exactly.

I'll try again asap to see if I can reproduce the bug.
The default behavior would be not to show you the localhost page but to return to the app with the retrieved token.

@Odonno
Copy link
Collaborator

Odonno commented Nov 23, 2016

I saw that I do not ended the Browser window the first moment we receive the event to go to the localhost page but I got the token as it should be so I am not sure it's the same problem.

Can you try the latest version of the package and see if there is any change ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants