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

Add twitter oauth provider #70

Closed
anatolym opened this issue Jun 4, 2018 · 13 comments
Closed

Add twitter oauth provider #70

anatolym opened this issue Jun 4, 2018 · 13 comments
Milestone

Comments

@anatolym
Copy link
Contributor

anatolym commented Jun 4, 2018

I'm gonna add Twitter OAuth provider to the project. This issue is for tracking progress.
(following the Umputun's comment #64 (comment))

@umputun
Copy link
Owner

umputun commented Jun 5, 2018

@anatolym - I have tried to add twitter once, but it wasn't as direct as I hopped. Don't recall details, but I think they don't even support oauth2 with 3-legs. All examples I have seen use oauth1 for twitter. If this is the case for real and not my misunderstanding - integrating Twitter as another provider can introduce some substantial changes to provider.go. If you can figure a nice way to do it - go ahead, will be great to have twitter login, but if too much code and too much trouble we can wait till twitter add oauth2 ;)

@anatolym
Copy link
Contributor Author

anatolym commented Jun 6, 2018

@umputun, it seems Twitter gave up on implementing OAuth2 protocol. They heave some weird 3-legged authorization which just doesn't make sense.
So current provider.go abstraction won't work and we have to implement oauth1 flow for Twitter API.

Also this discussion with OAuth2 feature request https://twittercommunity.com/t/oauth-2-0-support/253 started 7 years ago and was closed with no explanation by Twitter stuff last December.
Do we want twitter login that much?

@umputun
Copy link
Owner

umputun commented Jun 6, 2018

yeah, this is what I thought. Kill it, we will be just fine without twitter auth.

@anatolym
Copy link
Contributor Author

anatolym commented Jun 6, 2018

Alright.
@umputun, is there anything else I can do?

@umputun
Copy link
Owner

umputun commented Jun 8, 2018

@anatolym - There is a thing in the same area of auth - avatar proxy. Right now it's keeping the original image as-is and then serves it to users from AvatarStrore. It works, but the solution is not optimized. You can try to make it better by resizing images to the desired size and keep those tiny pics only instead of full originals. I think this resizing can happen synchronously at the time of login. In case this procedure is heavy for large images (I hope it is not that heavy) you may need some workes to do it in separate goroutines.

@umputun umputun closed this as completed Jun 11, 2018
@umputun
Copy link
Owner

umputun commented Aug 23, 2019

with https://github.com/go-pkgz/auth/releases/tag/v0.8.0 in place, we can finally have twitter auth

@umputun umputun reopened this Aug 23, 2019
umputun added a commit that referenced this issue Aug 23, 2019
@umputun
Copy link
Owner

umputun commented Aug 23, 2019

@Reeywhaar - I have added twitter auth provider, but probably you have to do it on your side as well.

@umputun
Copy link
Owner

umputun commented Oct 2, 2019

@Reeywhaar - pinging. Twitter support in place on my side, but need it to be added to your list of providers

GET http://admin:[email protected]:8080/api/v1/config?site=remark

HTTP/1.1 200 OK
App-Name: remark42
App-Version: local
Author: umputun
Cache-Control: no-cache, no-store, no-transform, must-revalidate, private, max-age=0
Content-Type: application/json; charset=utf-8
Expires: Wed, 31 Dec 1969 18:00:00 CST
Pragma: no-cache
Vary: Origin
X-Accel-Expires: 0
X-Rate-Limit-Duration: 1
X-Rate-Limit-Limit: 10.00
X-Rate-Limit-Request-Forwarded-For: 
X-Rate-Limit-Request-Remote-Addr: 172.18.0.1:46320
Date: Wed, 02 Oct 2019 16:35:33 GMT
Content-Length: 329

{
  "version": "local",
  "edit_duration": 300,
  "max_comment_size": 2048,
  "admins": [
    "dev_user"
  ],
  "admin_email": "[email protected]:8080",
  "auth_providers": [
    "twitter",
    "google",
    "github",
    "facebook",
    "dev",
    "email",
    "anonymous"
  ],
  "low_score": -5,
  "critical_score": -10,
  "positive_score": false,
  "readonly_age": 0,
  "max_image_size": 5000000,
  "emoji_enabled": true
}

@umputun umputun added this to the v1.5 milestone Oct 2, 2019
umputun added a commit that referenced this issue Oct 10, 2019
add twitter to the list of providers on frontend #70
@joseph-vidal-rosset
Copy link

with https://github.com/go-pkgz/auth/releases/tag/v0.8.0 in place, we can finally have twitter auth

In a new remark42 install, I would be glad to add twitter auth (even if I dislike Twitter as well as Facebook) but I did not understand on their developers page how to get it. A suggestion?

@joseph-vidal-rosset
Copy link

https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens

seems being the reply to my question. I hope so.

@joseph-vidal-rosset
Copy link

I have succeeded to get API keys for Tweeter (previously I had to submit a form as a developer, do not laugh ! :) ) ...
In my docker-compose:

  • AUTH_TWITTER_CID=2h***********************
  • AUTH_TWITTER_CSEC=uB5fV******************
    is it correct ?

@umputun
Copy link
Owner

umputun commented Nov 8, 2019

I have added the missing info about twitter to README as a part of 38e9dc9

@joseph-vidal-rosset
Copy link

Thanks. Glad to see I guessed the code correctly, but by induction, it was quite easy. :)

@umputun umputun closed this as completed Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants