YAFLogo

Posted by: DavidW - Friday, 11 May 2012 14:38:09
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

Posted by: tha_watcha - Friday, 11 May 2012 19:13:19
[quote=DavidW;54574]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[/quote] 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?

Posted by: DavidW - Friday, 11 May 2012 19:57:24
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.

Posted by: tha_watcha - Friday, 11 May 2012 20:24:23
[quote=DavidW;54580]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.[/quote] 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.

Posted by: DavidW - Friday, 11 May 2012 20:45:00
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

Posted by: DavidW - Tuesday, 15 May 2012 10:17:06
I have a customer waiting on this, is there any indication of what could be wrong?

Posted by: tha_watcha - Tuesday, 15 May 2012 15:27:34
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"

Posted by: DavidW - Tuesday, 15 May 2012 16:21:34
Thanks, that must be it, it's set to read only. I'll get this tested and I'll report back.

Posted by: DavidW - Tuesday, 15 May 2012 16:26:30
That was the problem. Thank you your time in helping sort this one out.

Posted by: jigglypuff2 - Wednesday, 13 June 2012 06:44:51
yeah, this got me too -- thanks!