birarda / logan

ruby gem to communicate with new Basecamp API
MIT License
16 stars 19 forks source link

Authenticate without basecamp_ID #15

Closed mattherick closed 10 years ago

mattherick commented 10 years ago

Hi!

I want to connect my users through the omniauth-basecamp gem to generate auth-tokens and afterwards fetch and save all the projects of a current user. Now I don´t want that the user has to fill in a form field with his/her basecamp_ID and submit everything to basecamp for authorization and authorize with the callback auth-tokens and the basecamp_ID the API request. I only want to hit one button/link which redirects to basecamp and back and handle the basecamp_ID recognition automatically. But my problem is, that the omniauth-callback only contains the credentials and within the credentials I only get the auth-token, but not the basecamp_ID.

Do you have any idea how we could expand your gem to handle my situation? I found something which seems to be interesting: https://gist.github.com/j7/6484428 but don´t know how I could integrate this in your gem.

Best regards,

Matthias

dphaener commented 10 years ago

Hey Matthias, I'm working on releasing a more robust version of that gem right now. It will do what you want it to. I'll have a release hopefully in the next few days. I'll keep you posted. Repository is at https://www.github.com/dphaener/base camp

Sent from my iPhone

On Jun 27, 2014, at 6:03 PM, Matthias Frick notifications@github.com wrote:

Hi!

I want to connect my users through the omniauth-basecamp gem to generate auth-tokens and afterwards fetch and save all the projects of a current user. Now I don´t want that the user has to fill in a form field with his/her basecamp_ID and submit everything to basecamp for authorization and authorize with the callback auth-tokens and the basecamp_ID the API request. I only want to hit one button/link which redirects to basecamp and back and handle the basecamp_ID recognition automatically. But my problem is, that the omniauth-callback only contains the credentials and within the credentials I only get the auth-token, but not the basecamp_ID.

Do you have any idea how we could expand your gem to handle my situation? I found something which seems to be interesting: https://gist.github.com/j7/6484428 but don´t know how I could integrate this in your gem.

Best regards,

Matthias

— Reply to this email directly or view it on GitHub.

dphaener commented 10 years ago

Hey again Matthias, had a chance to work on the gem this evening, and it's ready to go. Not 100% complete, but should work for what you need it for. https://github.com/dphaener/basecamp Hope it works out for you!

Darin

On Fri, Jun 27, 2014 at 6:03 PM, Matthias Frick notifications@github.com wrote:

Hi!

I want to connect my users through the omniauth-basecamp gem to generate auth-tokens and afterwards fetch and save all the projects of a current user. Now I don´t want that the user has to fill in a form field with his/her basecamp_ID and submit everything to basecamp for authorization and authorize with the callback auth-tokens and the basecamp_ID the API request. I only want to hit one button/link which redirects to basecamp and back and handle the basecamp_ID recognition automatically. But my problem is, that the omniauth-callback only contains the credentials and within the credentials I only get the auth-token, but not the basecamp_ID.

Do you have any idea how we could expand your gem to handle my situation? I found something which seems to be interesting: https://gist.github.com/j7/6484428 but don´t know how I could integrate this in your gem.

Best regards,

Matthias

— Reply to this email directly or view it on GitHub https://github.com/birarda/logan/issues/15.

birarda commented 10 years ago

@mattherick just looking at this now - do you still need changes to logan or has @dphaener solved this for you?

mattherick commented 10 years ago

@birarda: @dphaener solved the issue through his implementation. @dphaener: what is your further plan with your gem? maybe you both guys can work together..It seems for me, that both gems have a good code base, but also both did not cover all API features..

But anyway, this issue can be closed for the logan-gem.

Thx!

dphaener commented 10 years ago

I do plan on continuing development on this gem, however, it may be slow going as I have other projects that are of a higher priority at the moment. I would not be opposed to working together with @birarda, however do I have a few concerns about the implementation of the gem. I am open to discussion though, as this process would go a lot faster for both of us if we worked on it together.

On Fri, Jul 4, 2014 at 3:39 AM, Matthias Frick notifications@github.com wrote:

@birarda https://github.com/birarda: @dphaener https://github.com/dphaener solved the issue through his implementation. @dphaener https://github.com/dphaener: what is your further plan with your gem? maybe you both guys can work together..I seems for me, that both gems have a good code base, but also both did not cover all API features..

But anyway, this issue can be closed for the logan-gem.

thx!

— Reply to this email directly or view it on GitHub https://github.com/birarda/logan/issues/15#issuecomment-48029886.

birarda commented 10 years ago

@dphaener would be happy to combine efforts, not sure how that would work exactly.

dphaener commented 10 years ago

Well we can start by having you take a look at my codebase at https://github.com/dphaener/basecamp.

One difference is I am not supporting basic http authentication. Really because it did not fit for my use case, and it seems to add a lot of complexity to the codebase.

Also, I was never able to get some things working when I initially attempted to use the gem. For instance, inside of the todolists class, there are calls to Logan::Client.get, which I can see is using the the httparty class, but because the client class is not initialized, self.class.basecamp_id is never set and the api call never worked. I don't know if I'm missing something here or not, but it makes more sense to me to have these objects be a little more autonomous and instantiate an instance of the client class on itself. In this way it's not relying on some variable to be set. If you're using an environment variable for the basecamp account id, I don't like that either. Basecamp allows for one token to be used for several account id's. It just doesn't seem very flexible to me. I'd like to be able to pass around the account_id, that way several accounts can be used. In my opinion, the only hard coded variables that should be set would be the client_id and the client_secret that the app builder uses for oauth.

On the other hand, I love how you have created a class for every one of these basecamp items. It makes a lot of sense to receive an array of Logan::Todolist objects, rather than just a simple ruby hash. I like that part of the architecture and used that in my implementation.

Just a few thoughts. Let me know what you think.

Darin

On Tue, Jul 8, 2014 at 9:13 AM, Stephen Birarda notifications@github.com wrote:

@dphaener https://github.com/dphaener would be happy to combine efforts, not sure how that would work exactly.

— Reply to this email directly or view it on GitHub https://github.com/birarda/logan/issues/15#issuecomment-48361829.