https://github.com/mehcode/oauth1-rs
https://github.com/mehcode/oauth1-rs
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mehcode/oauth1-rs
- Owner: mehcode
- License: apache-2.0
- Created: 2017-10-18T20:30:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-30T15:15:22.000Z (over 4 years ago)
- Last Synced: 2025-03-18T06:51:27.727Z (12 months ago)
- Language: Rust
- Size: 21.5 KB
- Stars: 11
- Watchers: 2
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# OAuth1
> Basic OAuth1 library for Rust.
## Usage
```rust
extern crate oauth1;
extern crate reqwest;
use oauth1::Token;
use reqwest::Client;
use reqwest::header::AUTHORIZATION;
pub fn main() {
let client = Client::new();
let url = "https://api.twitter.com/1.1/account/verify_credentials.json";
let res = client.get(url)
.header(AUTHORIZATION, oauth1::authorize(
"GET",
url,
&Token::new("consumer_key", "consumer_secret"),
Some(&Token::new("auth_token", "auth_token_secret")),
None,
))
.send().unwrap();
}
```
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.