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:
RKrom 2012-09-09 13:53:53 +00:00
commit 79cbe548b0
4 changed files with 41 additions and 2 deletions

View file

@ -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));
}
}
}