what do I set for multipass to work when using your widget

I examined https://247fps.tenderapp.com/tender_widget.js to see how to get the SSO set, and it looks like if I do the following before I include the javascript it should work. However it doesn't. What am I doing wrong?

<script type="text/javascript" charset="utf-8">
  Tender = {
    sso: 'jJGIoUdNG87jy+ZNEx+dZ6wzkQq1KT/RNdJ4npbzfbaZI1Jw8U0mj1t1I5Ah
jxueh2aSpWsBpwhFF7lRfFexjyNZX4BfTAIphjIlJZqNWHcvdV1Nw2lMv0Hu
6m4ekJvD1RNK+z3/ETPG/AjfJJtORoQfyv0qoUrYMyRp0NGHdpU=
'
  }
</script>
  1. Do you have a login on Lighthouse? It has a working example (of course, you must be logged in to see it). Also, is the end quote really on the next line? I don't know if that's a copy/paste error or not. I'd think the example should look more like this:

    <script type="text/javascript" charset="utf-8">
      Tender = {
        sso: "jJGIoUdNG87jy+ZNEx+dZ6wzkQq1KT/RNdJ4npbzfbaZI1Jw8U0mj1t1I5Ah
    jxueh2aSpWsBpwhFF7lRfFexjyNZX4BfTAIphjIlJZqNWHcvdV1Nw2lMv0Hu
    6m4ekJvD1RNK+z3/ETPG/AjfJJtORoQfyv0qoUrYMyRp0NGHdpU="
      }
    </script>
    

    I may add some debug mode to the JS widget code.

    Also, check the new multipass debugger in the Extras section of your Tender dashboard. I modified the MultiPass spec a bit, but it should avoid weird url escaping issues (legacy multipasses are still fully compatible still).

  2. i just signed up for lighthouse, can you point me to the working example. Here's the erb that generates what I have.

    <% if current_user %>
    <script type="text/javascript" charset="utf-8">
      Tender = {
        sso: "<%= current_user.multipass() %>"
      }
    </script>
    <% end %>
    
  3. Try pasting the resulting multipass token into the multipass debugger.

  4. the problem seems to be that self.class.multipass.encode seems to be putting new lines in the result. I don't quite understand why.

  5. That's the output from the Base64 function. I've attached a beta of
    the new MultiPass gem that handles this much better, using "url safe
    base64 strings". I forgot to push the changes upstream from my
    laptop, and now it's at home.

    The MultiPass debug page shows the current rules that are supported by
    the new multipass gem.

    • multipass.tar.gz (available to support staff) 4.15 KB
  6. Thanks. That's what I"ve also just figured out. So it seems that if
    you want to add a tender.sso field, it needs to have the line breaks
    taken out. This seems like a useful thing to document.

    --dan

    PS We are evaluating using Tender for a new product & I'm super
    impressed with how easy the integration has been. Documentation is a
    bit confusing but not too bad.

  7. Did you check out the Multipass debugger? It has these steps outlined already. It's in the Extras section of the Admin dashboard. The SSO integration has gone through a few phases as we figure out what works best. Originally we only integrated with cookies, but that had other issues. I've been working with someone else with a similar issue like yours, and deployed the modified spec that mentions url-safe base64s yesterday.

  8. yah, I've used it. It's been quite helpful. But again, this
    particular wierdness has to do with trying to put an SSO as a tender
    initialization before calling the javascript (which I'm sure I can't
    be the only one trying to do this). the javascript doesn't like the
    newlines that base64 puts in, so I need to delete them from the string.

    --dan

  9. Yes, that's why I added it to the MultiPass page :) Are you referring
    to the Widget page? I didn't actually write it, and didn't realize it
    neglected to mention the SSO parameter at all. I'll fix that.

    I updated the multipass rules again. You can strip the trailing `=`
    symbol now. The code (using the old multipass gem, v1.1.x) might look
    something like this:

    @@@ ruby
    def current_multipass
      return nil if !logged_in? # assuming restful-auth?
      mp = current_user.multipass
      mp.gsub! /\n/, ''
      mp.chomp! '='
      mp.tr! '+', '-'
      mp.tr! '/', '_'
      mp
    end
    @@@

    Tomorrow I'll release an updated version of the Multipass gem that
    handles all this for you.

  10. Great! Didn't realize that I was on the bleeding edge here :-).
    You're an ace. Happy new year.

    --dan

  11. Is PHP 5.2 required to pass info to the widget? Seems like I need some kind of special JSON library. Is there any way around this?

  12. You don't need JSON, it's pretty easy to output formatted JSON by hand
    I suppose. There's also a pure PHP json lib. But, you do need an AES
    encryption library.

    http://mike.teczno.com/json.html

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