stevenkaras / omniauth-mailchimp

MailChimp OAuth2 strategies for omniauth
MIT License
3 stars 9 forks source link

Use MailChimp API V3 to get user details #1

Closed rymndhng closed 6 years ago

rymndhng commented 7 years ago

I noticed that the omniauth plugin currently uses V2 of the API. Can this gem be upgrade to use V3 of the API?

espen commented 7 years ago

I have a fork which uses v3 and it works by simply changing the path from v2 to v3. See https://github.com/espen/omniauth-mailchimp/commit/31e308f05d3c7b3dc771f64657f401b1f2451e47

SirRawlins commented 6 years ago

@rymndhng @espen this sounds good, especially as MailChimp has now dropped support for < V3 APis.

The issue I'm personally having today is that the request to the V2 API is failing for anyone who isn't Admin/Owner on the MailChimp account, Managers and Authors fail auth as a result.

I'll try your fork and see if behaves any better.

SirRawlins commented 6 years ago

I've just tested the use of V3 API and it no longer throws errors when trying to authorize with non-Admin/Owner accounts, so we can auth with Manager and Author roles.

I've put together a PR in #2 which makes the same changed as detailed in @espen's fork.

espen commented 6 years ago

IIRC endpoint should be returned as you need it when connecting to v3 of the api. As done here https://github.com/espen/omniauth-mailchimp/commit/7fe2bc9d0ea14a380258f8f0e357f442254bf1ee

SirRawlins commented 6 years ago

Sure thing. Want me to amend my PR?

On 24 Jan 2018 18:28, "Espen Antonsen" notifications@github.com wrote:

IIRC endpoint should be returned as you need it when connecting to v3 of the api. As done here espen/omniauth-mailchimp@7fe2bc9 https://github.com/espen/omniauth-mailchimp/commit/7fe2bc9d0ea14a380258f8f0e357f442254bf1ee

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stevenkaras/omniauth-mailchimp/issues/1#issuecomment-360228494, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtiK_SnZF9YhVhU2JeCnIM4fB-AORhlks5tN3Y0gaJpZM4N7sA9 .

stevenkaras commented 6 years ago

What the hell github?! Sorry, my notifications for the repo were turned off somehow.

I'll see about getting this fixed this weekend and pushing out a new gem version.

stevenkaras commented 6 years ago

I just pushed up 2.0.0 to rubygems.

I haven't tested this extensively with different user roles and mailchimp accounts, so please open new issues if you experience any issues.

espen commented 6 years ago

@stevenkaras awesome! I'm gonna test this soon and give feedback.

espen commented 6 years ago

@stevenkaras seems to be working good! Thanks for fixes and new release 🙌