#oauth

oauth1-header

Generate OAuth 1.0 Authorization headers

1 unstable release

0.1.0 Mar 26, 2020

#36 in #o-auth


Used in wolfie

CC0 license

8KB
130 lines

oauth1-header

Rust CI

Generate OAuth 1.0 Authorization headers.

License

CC0


lib.rs:

Generate OAuth 1.0 Authorization headers.

Example

use oauth1_header::http::Method;
use oauth1_header::Credentials;
use std::collections::HashMap;

let mut params = HashMap::new();
params.insert("foo", "bar");
let credentials = Credentials::new(
    "some-consumer-key",
    "some-consumer-secret",
    "some-token",
    "some-token-secret",
);
let header_value = credentials.auth(&Method::GET, "https://example.com", &params);

Where header_value will contain the OAuth Protocol Parameters ready to be sent in the HTTP Authorization header.

Dependencies

~3.5MB
~61K SLoC