justitems / midrub_cms

Midrub - the first CMS only for business
Other
54 stars 26 forks source link

ISSUE with Twitter Login #11

Closed inickiran closed 1 year ago

inickiran commented 1 year ago

Hello,

we have followed the documentation and created a twitter app with v1 api, (stand alone App). Stil its not working.

After authentication its redirected to auth/42 page but showing total blank page.

Thanks,

sirburuslan commented 1 year ago

Twitter app should be created with two version 1 and 2. Should be exactly like is configured the administrator -> user -> networks -> twitter. Otherwise won't work. Should be correct all redirects: 3

inickiran commented 1 year ago

I have doubled check the settings and followed all instructions and enabled the network.

Still we are redirected to a blank page with auth/42 URL.

Please guide us, also there is no db entry is happening for this user.

inickiran commented 1 year ago

1) we are not able to login using twitter 2) we are not able to connect the account form scheduler for twitter.

Screenshot 2022-11-22 at 5 42 22 PM Screenshot 2022-11-22 at 5 46 32 PM
sirburuslan commented 1 year ago

Please follow the documentation. https://cms.midrub.com/articles/how-to-configure-twitter-for-login-and-sign-up

Twitter is easy to be configured.

Please don't abuse. Use only to report bugs, not to ask for support.

inickiran commented 1 year ago

Hello,

We are not abusing, we are not doing this first time. Twitter app is setup correctly as per the guideline and still it's showing blank page after it's coming back to call back url, which shows the blank page, and DB entery is not happening for new user.

So it' s bug.

Thanks,

sirburuslan commented 1 year ago

In my demo it works. I know there isn't a bug because someone in the last summer has reported a lot same problem until i've seen that he didn't followed my video where i'm showing how is configured my app.

If you wish to use Twitter login, follow even one thousands of times the video until you will make it work, otherwise don't use the Twitter login.

inickiran commented 1 year ago

Hello,

We were not abusing, it's a fault of scope you have written in the code and documentation. May be you need to update your documentation for twitter scope OR default scope you have written with in your code.

AS per the latest API update form twitter to get the user profile data from twitter API, you need to pass two scope in combination "user.read and tweet.read". then only it will work. specifically for elevated apps created under having both API support.

Here is your code snippet.

BY DEFAULT you have passed below two scope "offline.access and users.read" // Scopes to request $scopes = array( 'offline.access', 'users.read' );

AND you are taking additional scope from the settings if exist. as per your documentation you have only mentioned "tweet.write"

    // Verify if additional scopes exists
    if ( md_the_option('network_twitter_scopes') )

AS soon as we have added tweet.read in settings it has worked.

inickiran commented 1 year ago

Here is the link where i have found the solution.

https://github.com/florianmartens/passport-twitter-oauth2.0/issues/1

alphatownsman commented on Apr 1 @nbrady-techempower I encountered similar issue but not using any code in this repo.

It seems to be an issue in Twitter's implementation on API scopes. Basically, in order to access https://api.twitter.com/2/users/me, you have to pass at least users.read tweet.read in scope, users.read alone won't work.

sirburuslan commented 1 year ago

No, for login/signup is used this application\base\admin\components\collection\frontend\networks\collection\twitter.php - and there is required the users.read scope already.

Anything is correct in application\base\user\networks\collection\twitter.php

I won't add there new scopes because you have additional scopes field to add the wanted scopes.

And I have written about 4 required scopes to add in the field additional scopes https://www.midrub.com/articles/how-to-configure-the-twitter-api-for-the-crm-social-app

sirburuslan commented 1 year ago

tweet.read is for reading of the tweets. It has nothing with our login/sign up. It is required in the user -> networks list because is used for posting. But for login is just required the user's id and email. Other things aren't necessary.

inickiran commented 1 year ago

We are refering to crm social app and plugin documentation, from code canyon. Which comes with bunch. In that in tweet.write is mentioned anyway thanks.

Screenshot 2022-11-23 at 3 15 22 PM

On Wed, 23 Nov, 2022, 2:17 pm scrisoft, @.***> wrote:

No, for login/signup is used this application\base\admin\components\collection\frontend\networks\collection\twitter.php

Anything is correct in application\base\user\networks\collection\twitter.php

I won't add there new scopes because you have additional scopes field to add the wanted scopes.

And I have written about 4 required scopes to add in the field additional scopes https://www.midrub.com/articles/how-to-configure-the-twitter-api-for-the-crm-social-app

— Reply to this email directly, view it on GitHub https://github.com/scrisoft/midrub_cms/issues/11#issuecomment-1324717527, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4KQEFGE4MQ6LNEPD2MH6N3WJXK2FANCNFSM6AAAAAASHWWXRA . You are receiving this because you authored the thread.Message ID: @.***>