aarondcoleman / Fitbit.NET

Fitbit .NET API Client Library
MIT License
195 stars 139 forks source link

Your solution #13

Closed MrMilan closed 10 years ago

MrMilan commented 10 years ago

Hello,

I am coder in asp.net MVC4. My boss was given me a task add Fitbit oAuth to my website project. And when I found your solution, I said in my mind "Supr I have done it". BUT I read yours project and in my oppinion is a nonstandard solution opposite to examples on http://www.asp.net/mvc/tutorials/security/using-oauth-providers-with-mvc

Have It a some reason or is It yours laziness do something kosher (right,correctly).

Thanks for replies

aarondcoleman commented 10 years ago

Hello, I'm not sure I understand the issue. The library is fairly standard as far as C# wrapper libraries go. The goal of this project is not to write your ASP.NET MVC project for you, but rather to save you the time of wiring up all the plumbing to / from the API and letting you work in just the strongly typed language.

In terms of why the sample MVC project is as it is: 1) It was created before MVC4 and the introduction of the new Microsoft OpenId providers 2) Is mostly designed to be agnostic to any C# platform (desktop / web / mobile / xamarin mobile) 3) From my conversations, more often Fitbit services are consumed to bring data in to an application that does other things. It's a "connect your Fitbit data and you can do X" flow rather than a "you need a Fitbit.com account to log in", which is what I think you're saying you need to build. The former doesn't require / want to mix ASP.NET Membership in to the equation.

Even the article you've attached illustrates this same division, as it relies on the Facebook C# API library to do all the plumbing work once the user's oauth token has been provided by the service. Microsoft just happen to write a Facebook OAuth provider you can uncomment in the default ASP.NET MVC4 starter project.

If what you're trying to do is log in a user to ASP.NET membership using Fitbit, you can easily do this in the style of the OpenId and implement that custom provider for Fitbit: http://blogs.msdn.com/b/pranav_rastogi/archive/2012/08/23/plugging-custom-oauth-openid-providers.aspx

If you choose do that and want to contribute back that code in to /SampleWebMVC project as a pull request, I'd be happy to accept it. Just don't remove the existing methods of OAuth since many will still want to leave ASP.NET membership alone and handle when / how they call the Fitbit API.

Thanks, --Aaron

aarondcoleman commented 10 years ago

Also note, even the way Microsoft has it done in their samples have continued to change from MVC4 to MVC5, so I'd hardly call this a "standard" yet.

(MVC 4 way you're requiring) http://www.asp.net/mvc/tutorials/security/using-oauth-providers-with-mvc

vs

(MVC 5 way) http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on

--Aaron

MrMilan commented 10 years ago

Hello,

thanks for your quick reply. You answer all my questions, why do you make this way. I read about differencies between MVC4 and MVC5. But I found in my opinion better solution here.

http://stackoverflow.com/questions/13953370/oauth-with-custom-oauth-provider-in-mvc-4 http://www.billdlabs.com/?p=45

This article made ​​me a little uncertain. I saw yours complex solution and this solution which was made tailored. Although he talks about his solution not completely kosher, but in my eyes is better. I see that solution of this problem is agnostic. My point of view is same like your. However I need a assurance that yours project was created complex (across version or software technology), not exactly for asp.net MVC.

I want answer why did not you make version for every version MVC. And I think you answered all my questions.

If you want you can supplement your reply.

Sorry for my making disillusionment but in some forums section "issues" is for suggestions, why and comments. And I started with biggest asking 4 month ago.

Thanks for your patience with dork programmer :)

--Milan