Changes

Jump to: navigation, search

Single Sign-On

3,044 bytes added, 17:31, 5 August 2014
Element Position
The 6th parameter (Parent Company) can result in changes to the organizational hierarchy. The Company (parameter 7) will be moved under the Parent Company, so this should be used with caution if this effect is not desired.
Contact SmartSimple for sample ===Cipher Encrypted Reference Sample Code===The following are examples of code for Cipher encrypted reference Encrypted Reference SSOconfiguration: ====PHP==== Sample and library: http://nl3.php.net/manual/en/mcrypt.ciphers.php====Java====No extra library required,    Sample code:<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"> import java.security.spec.KeySpec; import javax.crypto.Cipher;import javax.crypto.SecretKey;import javax.crypto.SecretKeyFactory;importjavax.crypto.spec.DESKeySpec;import sun.misc.BASE64Decoder;import sun.misc.BASE64Encoder; /** * *@author User */public class DESEncrypt { /**Creates a new instance of DESEncrypt */ public DESEncrypt() { } public static String encrypt(String keystr,String msg) {try{byte[] keyAsBytes = keystr.getBytes(); KeySpec myKeySpec = new DESKeySpec(keyAsBytes); SecretKeyFactory mySecretKeyFactory =SecretKeyFactory.getInstance("DES"); Cipher cipher Cipher.getInstance("DES/ECB/ PKCS5Padding"); SecretKey key =mySecretKeyFactory.generateSecret(myKeySpec); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] plainText = msg.getBytes(); byte[] encryptedText = cipher.doFinal(plainText); BASE64Encoder base64encoder = new BASE64Encoder(); return base64encoder.encode(encryptedText); }catch (Exception e){return null;} } public static String decrypt(String keystr,String msg) {try{byte[] keyAsBytes = keystr.getBytes(); KeySpec myKeySpec = new DESKeySpec(keyAsBytes); SecretKeyFactory mySecretKeyFactory =SecretKeyFactory.getInstance("DES"); Cipher cipher = Cipher.getInstance("DES/ECB/ PKCS5Padding"); SecretKey key =mySecretKeyFactory.generateSecret(myKeySpec); cipher.init(Cipher.DECRYPT_MODE, key); BASE64Decoder base64decoder = new BASE64Decoder(); byte[] encryptedText = base64decoder.decodeBuffer(msg); return new String(cipher.doFinal(encryptedText)); }catch (Exception e){return null;} }}</pre> ====Vb.Net Sample====<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Imports System.Security.Cryptography Public Function SSOEncrypt(ByValstrkey As String,ByVal strMessage AsString) Dim inputByteArray() AsByte = StrToByteArray(strMessage) Dim key As Byte() key =StrToByteArray(strkey) Dim des As New DESCryptoServiceProvider des.Mode = CipherMode.ECB des.Key = key Dim ms As New MemoryStream Dim cs As New CryptoStream(ms,des.CreateEncryptor(), CryptoStreamMode.Write) cs.Write(inputByteArray, 0, inputByteArray.Length) cs.FlushFinalBlock() Return Convert.ToBase64String(ms.ToArray()) End Function Public Shared FunctionStrToByteArray(ByVal str As String) As Byte() Dim encoding As New System.Text.UTF8Encoding Return encoding.GetBytes(str) End Function </pre>
==See Also==
8,849
edits

Navigation menu