Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6828781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:25:24+00:00 2026-05-26T22:25:24+00:00

I’m trying to automatically login my users into assistly.com with their multipass login as

  • 0

I’m trying to automatically login my users into assistly.com with their multipass login as described here: http://dev.assistly.com/docs/portal/multipass

I have tried to convert their code examples ( https://github.com/assistly/multipass-examples) to Actionscript using as3crypto, obviously without success.

Here’s what I have:

package
{
    import com.adobe.crypto.SHA1;
    import com.adobe.serialization.json.JSON;
    import com.hurlant.crypto.*
    import com.hurlant.util.Base64;
    import flash.utils.ByteArray;

    public class AssistlySingleSignOn
    {
        protected static var API_SITE_KEY:String = "YOUR SITE KEY"
        protected static var MULTIPASS_KEY:String = "YOUR MULTIPASS API KEY"

        public function AssistlySingleSignOn()
        {
        }

        public static function generateMultipass(uid:String, username:String, email:String):String
        {
            var o:Object = {};
            o.uid = uid;
            o.expires = "2012-12-29T10:25:28-08:00";
            o.customer_email = email;
            o.customer_name = username;

            var salted:String = API_SITE_KEY + MULTIPASS_KEY;
            var hash:String = SHA1.hash(salted);
            var saltedHash:String = hash.substr(0, 16);
            var iv:String = "OpenSSL for Ruby";

            var ivByteArray:ByteArray = new ByteArray();
            ivByteArray.writeUTFBytes(iv);

            var key:ByteArray = new ByteArray();
            key.writeUTFBytes(saltedHash);
            key.position = 0;

            var json:String = JSON.encode(o);
            var jsonByteArray:ByteArray = new ByteArray();
            jsonByteArray.writeUTFBytes(json);

            var padding:IPad = new PKCS5(16);
            ivByteArray.position = 0;

            key.position = 0;
            var cyphered:CBCMode = Crypto.getCipher("aes-128-cbc", key, padding) as CBCMode;
        jsonByteArray.position = 0;
        cyphered.IV = ivByteArray;
        cyphered.encrypt(jsonByteArray);

            jsonByteArray.position = 0;
        var base64:String = Base64.encode(jsonByteArray.readUTFBytes(jsonByteArray.length));

        /*Convert to a URL safe string by performing the following

        Remove any newlines
        Remove trailing equal (=) characters
        Change any plus (+) characters to dashes (-)
        Change any slashes (/) characters to underscores (_)*/

        base64 = base64.replace(/\n/g, "");
        base64 = base64.replace(/=/g, "");
        base64 = base64.replace(/+/g, "-");
        base64 = base64.replace(/\//g, "_");

        return base64;
        }
    }
}

I’m assuming that I’m doing something wrong with the IV stuff or the padding, because I don’t quite understand it 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:25:25+00:00Added an answer on May 26, 2026 at 10:25 pm

    You might want to use a different crypto class, or modify the as3crypto one. I know there are inconsistencies in the SHA1 function vs. the PHP sha1 function. See this:

    sha1 hash from as3crypto differs from the one made with PHP

    This could be making your values invalid. My recommendation would be to trace out all your data as it’s being calculated and run it against the same things in PHP or another of the examples in github. See where the data diverges. I’m betting it’s going to be issues relating to AS3Crypto.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.