/// <summary> /// Gets an encrypted API-key valid for 30 minutes. /// </summary> /// <param name="apiKey">The API-key</param> /// <returns>The ecnrypted key</returns> public static string APIKey(this HtmlHelper helper, Guid apiKey) { return(HttpUtility.UrlEncode(APIKeys.EncryptApiKey(apiKey))); }
/// <summary> /// Gets an encrypted API-key valid for 30 minutes. /// </summary> /// <param name="apiKey">The API-key</param> /// <returns>The ecnrypted key</returns> public IHtmlString APIKey(Guid apiKey) { return(new HtmlString(HttpUtility.UrlEncode(APIKeys.EncryptApiKey(apiKey)))); }
/// <summary> /// Checks that the given API-key is valid. /// </summary> /// <param name="context">The current service context</param> /// <returns>Whether the api key is valid or not.</returns> protected override bool CheckAccessCore(OperationContext context) { return(APIKeys.IsValidKey(GetAPIKey(context))); }