문제

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?

도움이 되었습니까?

해결책 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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top