예제 #1
0
        /// <summary>
        /// Complete the web authentication.
        /// </summary>
        public void AuthenticateViaWeb()
        {
            RequestParameters p = new RequestParameters();

            p["token"] = token;

            Request r = new Request("auth.getSession", this, p);

            r.signIt();

            XmlDocument doc = r.execute();

            SessionKey = doc.GetElementsByTagName("key")[0].InnerText;
        }
예제 #2
0
        /// <summary>
        /// Authenticate this session using a username and a md5 hash of the password.
        /// </summary>
        /// <param name="username">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="md5Password">
        /// A <see cref="System.String"/>
        /// </param>
        public void Authenticate(string username, string md5Password)
        {
            RequestParameters p = new RequestParameters();

            p["username"]  = username;
            p["authToken"] = LastFMScrobble.MD5(username + md5Password);

            Request request = new Request("auth.getMobileSession", this, p);

            request.signIt();

            XmlDocument doc = request.execute();

            SessionKey = doc.GetElementsByTagName("key")[0].InnerText;
        }