Example #1
0
        public OAuth20ConstructedAssertion ConstructAssertion(string userName)
        {
            // Get the UTC Date Timestamp
            string timestamp = DateTime.UtcNow.ToString("s") + "Z";

            // Setup the Assertion String
            string assertion = String.Format("{0}|{1}|{2}|{3}|{4}|{5}", clientName, publicKey, applicationId, clientString, userName, timestamp);

            // Generate the CMAC used for Assertion Security
            string cmac = OAuthUtilities.GenerateCmacHEX(privateKey, assertion);

            // Add the CMAC to the Assertion String
            string assertionFinal = String.Format("{0}|{1}", assertion, cmac);

            return(assertionFinal);
        }