Exemple #1
0
        public static MilkAuthToken ParseAuthToken(string rawRsp)
        {
            var rspXml = XElement.Parse(rawRsp);
            var auth   = rspXml.Element("auth");

            return(new MilkAuthToken(
                       auth.Element("token").Value,
                       MilkPerms.FromValue(auth.Element("perms").Value)
                       ));
        }
Exemple #2
0
        public string GenerateAuthUrl(MilkPerms perms, string frob)
        {
            var signature = signatureGenerator.Generate(
                new Dictionary <string, string>
            {
                { "api_key", context.ApiKey },
                { "perms", perms.ToString() },
                { "frob", frob },
            });

            return($"https://www.rememberthemilk.com/services/auth/?api_key={context.ApiKey}&perms={perms}&frob={frob}&api_sig={signature}");
        }