public string GetAuthCookie(HttpRequestMessage requestMessage) { if (requestMessage.RequestUri.PathAndQuery.ToLowerInvariant().Contains("REQUEST=GetCapabilities".ToLowerInvariant())) { return(string.Empty); } var token = _tokenHelper.GetTokenFromCookieHeader(requestMessage); if (String.IsNullOrEmpty(token)) { token = _tokenHelper.GetTokenFromAuthTokenHeader(requestMessage); } if (String.IsNullOrEmpty(token)) { return(String.Empty); } return(_hashHelper.Base64Decode(token)); }