This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static string GetSsoUrl(string baseUrl, string secret, string name, string email) { | |
var timems = (DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds.ToString(); | |
return String.Format("{0}/login/sso?name={1}&email={2}×tamp={3}&hash={4}", | |
baseUrl, Server.UrlEncode(name), Server.UrlEncode(email), timems, GetHash(secret, name, email, timems)); | |
} | |
private static string GetHash(string secret, string name, string email, string timems) { | |
var input = name + secret + email + timems; | |
var keybytes = Encoding.UTF8.GetBytes(secret); | |
var inputBytes = Encoding.UTF8.GetBytes(input); |