Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
OAuth2 (and OIDC) component for Yew
Add to your Cargo.toml:
= "0.12"
By default, the yew-nested-router integration for yew-nested-router is
disabled. You can enable it using:
= { = "0.12", = ["yew-nested-router"] }
OpenID Connect
OpenID Connect requires an additional dependency and can be enabled using the feature openid.
Examples
A quick example of how to use it (see below for more complete examples):
use *;
use *;
use *; // use `openid::*` when using OpenID connect
This repository also has some complete examples:
Use with either OpenID Connect or OAuth2.
Use with either OpenID Connect or OAuth2.
Testing
Testing the example projects locally can be done using a local Keycloak instance and trunk.
Start the Keycloak instance using:
podman-compose -f develop/docker-compose.yaml up
Then start trunk with the local developer instance:
cd yew-oauth2-example # or yew-oauth2-redirect-example
trunk serve
And navigate your browser to http://localhost:8080.
NOTE: It is important to use http://localhost:8080 instead of e.g. http://127.0.0.1:8080, as Keycloak is
configured by default to use http://localhost:* as a valid redirect URL when in dev-mode. Otherwise, you will get
an "invalid redirect" error from Keycloak.