I'm trying to get started by using the examples here.
I think the issue is that the examples are part of your workspace so the use of reqwest.
For example using the gitlab example results in the following compiler error:
error[E0433]: failed to resolve: could not find `ClientBuilder` in `blocking`
--> src/main.rs:53:42
|
53 | let http_client = reqwest::blocking::ClientBuilder::new()
| ^^^^^^^^^^^^^ could not find `ClientBuilder` in `blocking`
|
help: consider importing one of these structs
|
1 + use reqwest::ClientBuilder;
|
1 + use reqwest::blocking::ClientBuilder;
Removing use openidconnect::reqwest; and adding reqwest = { version = "0.12.5", features = ["blocking"] } to the Cargo.toml results in another compiler error with unsatisfied trait bounds on the http_client when using the discover() associated function.
error[E0277]: expected a `Fn(HttpRequest)` closure, found `reqwest::blocking::Client`
--> src/main.rs:63:74
|
63 | ... = CoreProviderMetadata::discover(&issuer_url, &http_client)
| ------------------------------ ^^^^^^^^^^^ expected an `Fn(HttpRequest)` closure, found `reqwest::blocking::Client`
| |
| required by a bound introduced by this call
|
= help: the trait `Fn(HttpRequest)` is not implemented for `reqwest::blocking::Client`, which is required by `&reqwest::blocking::Client: Fn(HttpRequest)`
= note: required for `&reqwest::blocking::Client` to implement `Fn(HttpRequest)`
I think one way to improve the onboarding for users would be to make the examples/ directory standalone and not part of the crate's workspace. This would make it reproducible.
The main branch corresponds to the 4.0 release, currently in alpha. Please be sure you're using the examples from the same version of the crate you're importing.
I'm trying to get started by using the examples here.
I think the issue is that the examples are part of your workspace so the use of reqwest.
For example using the gitlab example results in the following compiler error:
Removing
use openidconnect::reqwest;
and addingreqwest = { version = "0.12.5", features = ["blocking"] }
to theCargo.toml
results in another compiler error with unsatisfied trait bounds on thehttp_client
when using thediscover()
associated function.I think one way to improve the onboarding for users would be to make the
examples/
directory standalone and not part of the crate's workspace. This would make it reproducible.