public ServiceFactory() { AuthConfig = new AuthConfig(); AuthConfig.ApiAccessKey = ConfigurationManager.AppSettings["ALMSApiAccessKey"]; AuthConfig.ApiSecretKey = ConfigurationManager.AppSettings["ALMSApiSecretKey"]; BaseApiURI = ConfigurationManager.AppSettings["ALMSBaseApiURI"]; }
protected internal static string GenerateNonce(AuthConfig config, DateTimeOffset httpRequestUTCDate) { string content = config.ApiAccessKey + " " + httpRequestUTCDate.ToString(CultureInfo.CurrentCulture.DateTimeFormat.RFC1123Pattern); byte[] keyByte = System.Text.Encoding.UTF8.GetBytes(config.ApiSecretKey); var hmacsha256 = new System.Security.Cryptography.HMACSHA256(keyByte); byte[] messageBytes = System.Text.Encoding.UTF8.GetBytes(content); byte[] hashmessage = hmacsha256.ComputeHash(messageBytes); string sbinary = ""; for (int i = 0; i < hashmessage.Length; i++) sbinary += hashmessage[i].ToString("X2"); // hex format return sbinary; }
public MasterCourseService(AuthConfig authConfig, string baseApiURI) : base(authConfig, baseApiURI) { }
public OrganizationService(AuthConfig authConfig, string baseApiURI) : base(authConfig, baseApiURI) { }
public GroupService(AuthConfig authConfig, string baseApiURI) : base(authConfig, baseApiURI) { }
public UserService(AuthConfig authConfig, string baseApiURI) : base(authConfig, baseApiURI) { }
public ClassService(AuthConfig authConfig, string baseApiURI) : base(authConfig, baseApiURI) { }