DavidW
  • Posts: 18
  • Joined: 15/11/2011
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
tha_watcha
  • Posts: 4036
  • Joined: 06/03/2010
Originally Posted by: DavidW

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



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?

UserPostedImage
DavidW
  • Posts: 18
  • Joined: 15/11/2011
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
  • Posts: 4036
  • Joined: 06/03/2010
Originally Posted by: DavidW

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.



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.
UserPostedImage
DavidW
  • Posts: 18
  • Joined: 15/11/2011
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
  • Posts: 18
  • Joined: 15/11/2011
I have a customer waiting on this, is there any indication of what could be wrong?
tha_watcha
  • Posts: 4036
  • Joined: 06/03/2010
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"

UserPostedImage
DavidW
  • Posts: 18
  • Joined: 15/11/2011
Thanks, that must be it, it's set to read only. I'll get this tested and I'll report back.
DavidW
  • Posts: 18
  • Joined: 15/11/2011
That was the problem. Thank you your time in helping sort this one out.
jigglypuff2
  • Posts: 16
  • Joined: 05/03/2012
yeah, this got me too -- thanks!
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved