Auto login cookies

Patrick McEvoy's Avatar

Patrick McEvoy

10 Apr, 2009 04:27 PM

We're having problems implementing this, getting "Sorry, there was an error logging you in from Clubhouse's cookies."

Is there anyway to find out what that error was? :)

I've squashed a few bugs from our original code when looking for what could be wrong, and I'm sure things are right at our end now.

Also as far as I'm aware this isn't correct, it's the other way around!

Since you're setting cookies on ".yourapp.com" you'll need to make sure you're not logging people in on "www.yourapp.com", because browser security settings won't let the user create a wildcard cookie.

We're logging all people in on login.clubhouseapp.com, and all our accounts have unique subdomains, support subdomain should be no different....

  1. Support Staff 1 Posted by Courtenay on 10 Apr, 2009 06:30 PM

    Courtenay's Avatar

    If the cookies are all there and being set (you can determine this by inspecting them in the browser), the "error" is basically that your hmac signed string (tender_hash) doesn't match up. What language are you coding this in?

  2. 2 Posted by Patrick McEvoy on 10 Apr, 2009 07:00 PM

    Patrick McEvoy's Avatar

    Yeah the cookies are there, using firecookie to check.

    It's in C#, however I've used the test data ('monkey', etc) at the bottom of your article to confirm that the hmac is right...

  3. 3 Posted by Patrick McEvoy on 10 Apr, 2009 07:25 PM

    Patrick McEvoy's Avatar

    http://monoport.com/40349

  4. 4 Posted by Patrick McEvoy on 14 Apr, 2009 04:32 PM

    Patrick McEvoy's Avatar

    Any new ideas on this one?

  5. Support Staff 5 Posted by Courtenay on 14 Apr, 2009 07:21 PM

    Courtenay's Avatar

    You're sure you are using the correct secret?

  6. Support Staff 6 Posted by Courtenay on 14 Apr, 2009 07:26 PM

    Courtenay's Avatar

    We're having Rick (who speaks C#, at least a variant of it) take a look.

  7. Support Staff 7 Posted by Courtenay on 14 Apr, 2009 07:28 PM

    Courtenay's Avatar

    Can you paste all the cookie values too? That will help us debug.

  8. Support Staff 8 Posted by Courtenay on 14 Apr, 2009 07:30 PM

    Courtenay's Avatar

    Also, what exact string value are you passing to the HMAC function?

  9. 9 Posted by rick on 14 Apr, 2009 08:12 PM

    rick's Avatar

    Hey Patrick, I'm installing mono so I can try this out.

  10. 10 Posted by Patrick McEvoy on 14 Apr, 2009 09:12 PM

    Patrick McEvoy's Avatar

    Thanks guys, this effort is muchly appreciated!

    I'm pretty sure I'm using the right secret, but I enabled it way back when you were in (or just out off) private beta, so perhaps reseting it might clear things up?!

    Cookies...

    tender_hash=CE29AB5FCA189F768236F8D1BE28EEBB6B0F532B; expires=Tue, 28 Apr 2009 21:04:45 GMT; path=/; domain=.clubhouseapp.com tender_expires=1240956361; expires=Tue, 28 Apr 2009 21:04:45 GMT; path=/; domain=.clubhouseapp.com tender_email=[email blocked]; expires=Tue, 28 Apr 2009 21:04:45 GMT; path=/; domain=.clubhouseapp.com

    Code to gen hash, set the cookies http://monoport.com/40406

  11. Support Staff 11 Posted by Courtenay on 14 Apr, 2009 09:15 PM

    Courtenay's Avatar

    What's epoch.toString look like?

  12. 12 Posted by Patrick McEvoy on 14 Apr, 2009 09:16 PM

    Patrick McEvoy's Avatar

    Checked it, it all matches up just like the cookie value... 1240956361

  13. Support Staff 13 Posted by Courtenay on 14 Apr, 2009 09:17 PM

    Courtenay's Avatar

    Hmm, your tender hash is all upper cased.

  14. Support Staff 14 Posted by Courtenay on 14 Apr, 2009 09:17 PM

    Courtenay's Avatar

    Try lower-casing your tender_hash.

  15. 15 Posted by Patrick McEvoy on 14 Apr, 2009 09:17 PM

    Patrick McEvoy's Avatar

    I wrote a little console app to test it all, not got it now tho, it's on my laptop at work

  16. Support Staff 16 Posted by Courtenay on 14 Apr, 2009 09:18 PM

    Courtenay's Avatar

    We definitely require your tender_hash to be lower cased.

  17. 17 Posted by Patrick McEvoy on 14 Apr, 2009 09:19 PM

    Patrick McEvoy's Avatar

    Ah!!! I'm gonna pop that it svn and deploy to our production box, I'll get back to you

  18. 18 Posted by Patrick McEvoy on 14 Apr, 2009 09:36 PM

    Patrick McEvoy's Avatar

    Yep, we're working now... thanks guys...

    Also I've just seen how you take the first part of the email address as an initial name. Why not let us set 'tender_fullname' initially till (or if) tender gets a change in the profile. To be fair most users are lazy and won't bother setting a password or updating there name as they don't have too. However someone might get confused not seeing there name there. We deal with wide range of user ages from 12-70+ and every little helps to ensure we do (and don't!!) get support tickets!!

  19. Support Staff 19 Posted by Courtenay on 01 May, 2009 11:27 PM

    Courtenay's Avatar

    Patrick,

    rtfm :) tender_name is how you set that. https://help.tenderapp.com/faqs/setup-installation/include-custom-information-from-your-site

  20. Support Staff 20 Posted by Courtenay on 01 May, 2009 11:30 PM

    Courtenay's Avatar

    If you want to ensure the users don't set their own name, you want to add tender_name to the hmac at the end. So you'd sign (in ruby)

    generate_hmac([self.class.support_domain, @user.email, expires, name_field].compact.join("/"))

    (or in pseudocode)

    was: help.mysite.com/[email blocked]/1244023432

    becomes: help.mysite.com/[email blocked]/1244023432/Mr Foo Bar

    We actually check for both versions.

  21. Courtenay closed this discussion on 01 May, 2009 11:30 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac