Skip to content

Commit

Permalink
Update simple usage text README.md
Browse files Browse the repository at this point in the history
The `AuthenticationManager` struct has been removed and replaced with the `provider()` method, making the instructions on `README.md` outdated.

This PR is a minimal change to correct the documentation, based on the example in the rustdoc on lib.rs.
  • Loading branch information
andreban authored and djc committed May 29, 2024
1 parent 1b2b682 commit 5a1e48d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ This crate does not currently support Windows.

## Simple usage

The default way to use this library is to get instantiate an `AuthenticationManager`. It will
The default way to use this library is to select the appropriate token provider using `provider()`. It will
find the appropriate authentication method and use it to retrieve tokens.

```rust,no_run
use gcp_auth::AuthenticationManager;
let authentication_manager = AuthenticationManager::new().await?;
let provider = gcp_auth::provider().await?;
let scopes = &["https://www.googleapis.com/auth/cloud-platform"];
let token = authentication_manager.get_token(scopes).await?;
let token = provider.token(scopes).await?;
```

# License
Expand Down

0 comments on commit 5a1e48d

Please sign in to comment.