Domanda

Is there an easy way to scramble value in input parameter of the MS CRM 2011 workflow?

I have workflow with bunch of custom steps for performing some actions in third-party systems. This requires passing URL and credentials to that system.

And I wondering is there any possibility to scramble input parameters? So it will be safe not to expose this login information to all users?

È stato utile?

Soluzione 2

I did as Guido Preite suggested. Wrote two simple functions to scramble and de-scramble authentication string using simple XOR:

private static string Encode(string text)
{
    byte[] result = Encoding.ASCII.GetBytes(text);
    int[] values = new int[result.Length];

    for (int i = 0; i < text.Length; i++)
    {
        result[i] = (byte)(Convert.ToInt32(text[i]) ^ 42);
    }

    return Convert.ToBase64String(result);
}

private static string Decode(string text)
{
    byte[] result = Convert.FromBase64String(text);

    for (int i = 0; i < result.Length; i++)
    {
        result[i] = (byte)(result[i] ^ 42);
    }

    return Encoding.ASCII.GetString(result);
}

The key to the scrambled string is 42.

Altri suggerimenti

You can implement your encoding technique, and perform the decoding part inside the workflow activity.

It's the easiest way to hide the credentials for the users.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top