FlickrNet.Flickr.AuthCalcUrl C# (CSharp) Method

AuthCalcUrl() public method

Calculates the URL to redirect the user to Flickr web site for authentication. Used by desktop application. See AuthGetFrob for example code.
public AuthCalcUrl ( string frob, AuthLevel authLevel ) : string
frob string The FROB to be used for authentication.
authLevel AuthLevel The stating the maximum authentication level your application requires.
return string
        public string AuthCalcUrl(string frob, AuthLevel authLevel)
        {
            if( _sharedSecret == null ) throw new FlickrException(0, "AuthGetToken requires signing. Please supply api key and secret.");

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

            return url;
        }

Usage Example

Exemplo n.º 1
0
 public static void OpenAuthURL()
 {
     Flickr flickr = new Flickr(ApiKey, SharedSecret);
     frob = flickr.AuthGetFrob();
     AuthUrl = flickr.AuthCalcUrl(frob, AuthLevel.Write);
     System.Diagnostics.Process.Start(AuthUrl);
 }
All Usage Examples Of FlickrNet.Flickr::AuthCalcUrl
Flickr