ramosbugs / oauth2-rs

Extensible, strongly-typed Rust OAuth2 client library
Apache License 2.0
929 stars 162 forks source link

Implicit Grant Flow Documentation is Incorrect #286

Closed spotthecow closed 1 month ago

spotthecow commented 1 month ago

The documentation for the implicit grant flow is incorrect and it is unclear how to use this crate for the implicit grant flow. The implicit grant flow does not use a client secret, yet the example in the doc includes one. The implicit grant flow also DOES require a redirect uri, but the example does NOT include one. I would submit a PR to fix the doc, but I'm struggling to figure out how to use this crate for this flow.

ramosbugs commented 1 month ago

The implicit grant flow does not use a client secret, yet the example in the doc includes one.

Ah yes, good catch. The secret doesn't get used for anything, but it shouldn't be part of the example.

The implicit grant flow also DOES require a redirect uri, but the example does NOT include one.

No, the redirect_uri is optional. If omitted, the server should use the redirect URI previously configured for use with the provided client ID.

In any case, if you look at the docs beyond the examples, you'll see a set_redirect_uri method for this purpose. The examples are intended as a starting point; not a replacement for referencing the complete API documentation.