mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Added the possibility to automatically encrypt/decrypt a configuration value by setting "Encrypted" in the ini to true. Also added a small OAuth example in the ImgurUtils, for later usage.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2014 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
b2ea24fd9a
commit
79cbe548b0
4 changed files with 41 additions and 2 deletions
|
@ -261,5 +261,22 @@ namespace GreenshotImgurPlugin {
|
|||
|
||||
} catch {}
|
||||
}
|
||||
|
||||
private static void ImgurOAuthExample() {
|
||||
OAuthHelper oAuth = new OAuthHelper();
|
||||
oAuth.CallbackUrl = "http://getgreenshot.org";
|
||||
oAuth.AccessTokenUrl = "https://api.imgur.com/oauth/access_token";
|
||||
oAuth.AuthorizeUrl = "https://api.imgur.com/oauth/authorize";
|
||||
oAuth.RequestTokenUrl = "https://api.imgur.com/oauth/request_token";
|
||||
oAuth.ConsumerKey = "907d4455b8c38144d68c4f72190af4c40504a0ac7";
|
||||
oAuth.ConsumerSecret = "d33902ef409fea163ab755454c15b3d0";
|
||||
oAuth.UserAgent = "Greenshot";
|
||||
oAuth.getRequestToken();
|
||||
if (string.IsNullOrEmpty(oAuth.authorizeToken("Imgur authorization"))) {
|
||||
return;
|
||||
}
|
||||
string accessToken = oAuth.getAccessToken();
|
||||
MessageBox.Show(oAuth.oAuthWebRequest(OAuth.Method.GET, "http://api.imgur.com/2/account", null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue