예제 #1
0
        public Uri GetOAuthCalculatedAuthorizationUri(OAuthRequestToken requestToken)
        {
            if (requestToken == null) throw new ArgumentNullException("requestToken");
            if (string.IsNullOrEmpty(requestToken.Token)) throw new InvalidOperationException();

            var oAuthUrl = _flickr.OAuthCalculateAuthorizationUrl(requestToken.Token, FlickrNet.AuthLevel.Write);

            return new Uri(oAuthUrl);
        }
예제 #2
0
        public static OAuthRequestToken CreateSingle()
        {
            var entity = new OAuthRequestToken();

            entity.Token = string.Format(CultureInfo.InvariantCulture, "Token {0}", entity.Id);
            entity.TokenSecret = string.Format(CultureInfo.InvariantCulture, "TokenSecret {0}", entity.Id);

            return entity;
        }
예제 #3
0
        public OAuthAccessToken GetOAuthAccessToken(OAuthRequestToken requestToken, string verifier)
        {
            if (requestToken == null) throw new ArgumentNullException("requestToken");

            var accessToken = _flickr.OAuthGetAccessToken(requestToken.Token, requestToken.TokenSecret, verifier);

            return new OAuthAccessToken
                       {
                           FullName = accessToken.FullName,
                           Token = accessToken.Token,
                           TokenSecret = accessToken.TokenSecret,
                           UserId = accessToken.UserId,
                           Username = accessToken.Username,
                       };
        }