示例#1
0
 /// <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)));
 }
示例#2
0
 /// <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))));
 }
示例#3
0
 /// <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)));
 }