YAFLogo

DavidW
  • DavidW
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
12 years ago
I have set up Single Sign On for Twitter and set up the Twitter App. Users can now see the 'Sign on using Twitter' button on the login page and when they sign in using their Twitter account the corresponding account is created in YAF. However the user's profile flag 'Did you want to Use Single Sign On?' is disabled and they can't fully login, instead receiving an unhelpful error notification.

Surely if Twitter Sign On has been enable then 'Did you want to Use Single Sign On?' should be set to true for that user during the account creation process otherwise it's a pointless exercise?

Any help would be appreciated.

YAF Version 1.9.6.1

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago

I have set up Single Sign On for Twitter and set up the Twitter App. Users can now see the 'Sign on using Twitter' button on the login page and when they sign in using their Twitter account the corresponding account is created in YAF. However the user's profile flag 'Did you want to Use Single Sign On?' is disabled and they can't fully login, instead receiving an unhelpful error notification.

Surely if Twitter Sign On has been enable then 'Did you want to Use Single Sign On?' should be set to true for that user during the account creation process otherwise it's a pointless exercise?

Any help would be appreciated.

YAF Version 1.9.6.1

Originally Posted by: DavidW 

The default value is set to true also when register via Facebook.

My only guess is that the registering was not complete, maybe an exception that stops the process. Did you get an pm and dm after registering?

DavidW
  • DavidW
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
12 years ago
Did not get DM in Twitter, PM's are disabled in YAF. The registration appears to have succeeded as the user is flagged as registered user and details from Twitter account have been recorded.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago

Did not get DM in Twitter, PM's are disabled in YAF. The registration appears to have succeeded as the user is flagged as registered user and details from Twitter account have been recorded.

Originally Posted by: DavidW 

Ok if you don't receive any DM the registration process wasn't completed. Was no error message shown during setup?

I will add some logging to the event log if something goes wrong.

DavidW
  • DavidW
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
12 years ago
The error return when the user attempts to login using Twitter authentication is...

Server Error in '/' Application.

The remote server returned an error: (401) Unauthorized.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (401) Unauthorized.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[WebException: The remote server returned an error: (401) Unauthorized.]

System.Net.HttpWebRequest.GetResponse() +7864708

YAF.Core.Services.Twitter.OAuthTwitter.WebResponseGet(HttpWebRequest webRequest) +281

YAF.Core.Services.Twitter.OAuthTwitter.WebRequest(Method method, String url, String postData) +292

YAF.Core.Services.Twitter.OAuthTwitter.OAuthWebRequest(Method method, String url, String postData) +1155

YAF.Core.Services.Twitter.TweetAPI.SendDirectMessage(ResponseFormat reponse_format, String screen_name, String message) +289

YAF.Core.Services.YafSingleSignOnUser.SendRegistrationMessageToUser(MembershipUser user, String pass, String securityAnswer, Int32 userId, OAuthTwitter oAuth) +1227

YAF.Core.Services.YafSingleSignOnUser.LoginTwitterUser(HttpRequest request, String& message) +1700

YAF.Auth.Page_Load(Object sender, EventArgs e) +343

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25

System.Web.UI.Control.LoadRecursive() +71

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

DavidW
  • DavidW
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
12 years ago
I have a customer waiting on this, is there any indication of what could be wrong?
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago
I can only guess what could be wrong, if a 401 is returned this can happen when a access token is not correct. But you wrote that the user was correctly created, so thats not the problem.

Take a look at the application settings of your twitter app is it set to "Read only" under Application type? It needs to be set to "Read and Write"

DavidW
  • DavidW
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
12 years ago
Thanks, that must be it, it's set to read only. I'll get this tested and I'll report back.
DavidW
  • DavidW
  • 60.8% (Friendly)
  • YAF Camper Topic Starter
12 years ago
That was the problem. Thank you your time in helping sort this one out.
jigglypuff2
12 years ago
yeah, this got me too -- thanks!