public string CreateSignature(X509Certificate2 certificate, IToken token, Uri uri, string verb, string verifier = null, bool renewToken = false, string callback = null) { var oAuthParameters = new OAuthParameters( new ConsumerKey(token.ConsumerKey), //Modified to fix oauth error for private app //new TokenKey(token.TokenKey), new TokenKey(token.ConsumerKey), "RSA-SHA1", new DefaultTimestampSequence(), new DefaultNonceSequence(), string.Empty, "1.0", verifier, token.Session, renewToken, callback); var signatureBaseString = new SignatureBaseString( new Request { Url = uri, Verb = verb }, oAuthParameters); var signature = new RsaSha1(certificate).Sign(signatureBaseString); oAuthParameters.SetSignature(signature); return new AuthorizationHeader(oAuthParameters, string.Empty, renewToken).Value; }
public string CreateSignature(X509Certificate2 certificate, IToken token, Uri uri, string verb, string verifier = null) { var oAuthParameters = new OAuthParameters( new ConsumerKey(token.ConsumerKey), new TokenKey(token.ConsumerKey), "RSA-SHA1", new DefaultTimestampSequence(), new DefaultNonceSequence(), string.Empty, "1.0", verifier, token.Session); var signatureBaseString = new SignatureBaseString( new Request { Url = uri, Verb = verb }, oAuthParameters); var signature = new RsaSha1(certificate).Sign(signatureBaseString); oAuthParameters.SetSignature(signature); return new AuthorizationHeader(oAuthParameters, string.Empty).Value; ; }
public string CreateSignature(IToken token, Uri uri, string verb, string verifier = null, string callback = null) { var oAuthParameters = new OAuthParameters( new ConsumerKey(token.ConsumerKey), new TokenKey(token.TokenKey), "HMAC-SHA1", new DefaultTimestampSequence(), new DefaultNonceSequence(), string.Empty, "1.0", verifier, token.Session, false, callback); var signatureBaseString = new SignatureBaseString( new Request { Url = uri, Verb = verb }, oAuthParameters); var signature = new HmacSha1().Sign(signatureBaseString, token.ConsumerSecret, token.TokenSecret); oAuthParameters.SetSignature(signature); return new AuthorizationHeader(oAuthParameters, string.Empty).Value; }
public AuthorizationHeader(OAuthParameters oAuthParameters, string realm) { _oAuthParameters = oAuthParameters; _realm = realm; }
internal ParameterPart(Request request, OAuthParameters oAuthParameters) { _request = request; _oAuthParameters = oAuthParameters; }
public SignatureBaseString(Request request, OAuthParameters oAuthParameters) { _request = request; _oAuthParameters = oAuthParameters; }
public AuthorizationHeader(OAuthParameters oAuthParameters, string realm, bool includeSession = false) { _oAuthParameters = oAuthParameters; _realm = realm; _includeSession = includeSession; }