Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="names"></param>
        /// <returns></returns>
        public static AuthorizationRequest CreateAuthorizationRequest(this NameValueCollection names)
        {
            if (null == names)
                throw new ArgumentNullException("names");

            var message = new AuthorizationRequest();

            foreach (String key in names.Keys)
            {
                String value = names[key];
                if (false == key.StartsWith("wrap_", StringComparison.OrdinalIgnoreCase) || String.IsNullOrEmpty(value))
                    continue;
                message.SetParameter(key, value);
            }
            message.Validate();

            return message;
        }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="response"></param>
 /// <param name="baseUri"></param>
 /// <param name="message"></param>
 public static void WriteRequest(this HttpResponse response, String baseUri, AuthorizationRequest message)
 {
     response.Redirect(baseUri + "?" + message.ToString());
 }