string GetFetchValue(FetchResponse fetch, string key)
 {
     string schema = "http://schema.openid.net/";
     IList<string> results = fetch.GetAttribute(schema + key).Values;
     string result = results.Count > 0 ? results[0] : "";
     return result;
 }
Example #2
0
        IDictionary <string, string> IExtensionRequest.Serialize(RelyingParty.IAuthenticationRequest authenticationRequest)
        {
            var fields = new Dictionary <string, string> {
                { "mode", Mode },
            };

            FetchResponse.SerializeAttributes(fields, attributesProvided);

            return(fields);
        }
Example #3
0
        bool IExtensionRequest.Deserialize(IDictionary <string, string> fields, DotNetOpenId.Provider.IRequest request, string typeUri)
        {
            if (fields == null)
            {
                return(false);
            }
            string mode;

            fields.TryGetValue("mode", out mode);
            if (mode != Mode)
            {
                return(false);
            }

            foreach (var att in FetchResponse.DeserializeAttributes(fields))
            {
                AddAttribute(att);
            }

            return(true);
        }
		public void AddAttributeNull() {
			var response = new FetchResponse();
			response.AddAttribute(null);
		}
		public void AddAttributeTwice() {
			var response = new FetchResponse();
			response.AddAttribute(new AttributeValues("http://someattribute", "Value1"));
			response.AddAttribute(new AttributeValues("http://someattribute", "Value1"));
		}
		public void AddTwoAttributes() {
			var response = new FetchResponse();
			response.AddAttribute(new AttributeValues("http://someattribute", "Value1"));
			response.AddAttribute(new AttributeValues("http://someOtherAttribute", "Value2"));
		}