FlickrNet.Flickr.AuthCalcWebUrl C# (CSharp) Method

AuthCalcWebUrl() public method

Calculates the URL to redirect the user to Flickr web site for auehtntication. Used by Web applications. See AuthGetFrob for example code.
The Flickr web site provides 'tiny urls' that can be used in place of this URL when you specify your return url in the API key page. It is recommended that you use these instead as they do not include your API or shared secret.
public AuthCalcWebUrl ( AuthLevel authLevel ) : string
authLevel AuthLevel The stating the maximum authentication level your application requires.
return string
        public string AuthCalcWebUrl(AuthLevel authLevel)
        {
            if( _sharedSecret == null ) throw new FlickrException(0, "AuthGetToken requires signing. Please supply api key and secret.");

            string hash = _sharedSecret + "api_key" + _apiKey + "perms" + authLevel.ToString().ToLower();
            hash = Md5Hash(hash);
            string url = AuthUrl + "?api_key=" + _apiKey + "&perms=" + authLevel.ToString().ToLower();
            url += "&api_sig=" + hash;

            return url;
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// this method will get our Flickr Frob URL
        /// </summary>
        /// <returns></returns>
        public string GetFlickrFrobURL()
        {
            string auth_url = flickr.AuthCalcWebUrl(AuthLevel.Write);

            return(auth_url);
        }
Flickr