Repository navigation
Provider compatibility and endpoint security fixes. This release is breaking (see "Migration" below).
Breaking changes
- Provider endpoints now require https. The discovery document, the JWK set, the token endpoint (it carries the client secret, or the username/password in the password grant), the userinfo and introspection endpoints (they carry bearer tokens) and the UMA2 endpoints reject plain
httpwithError::Insecureor the newClientError::Insecure. Before this release only the JWK set fetch was checked. Two docstrings already promisedError::Insecurefor userinfo and introspection; they now do. ClientError::Insecure(url::Url)added, so an exhaustivematchonClientErrorneeds a new arm.
Migration
A development provider, e.g. Keycloak on http://localhost:8080, needs the explicit opt-out - there are no boolean flags:
// discovery (the request itself has to be allowed to use http)
let client = DiscoveredClient::discover_insecure(id, secret, redirect, issuer).await?;
// UMA2
let client = DiscoveredUma2Client::discover_uma2_insecure(id, secret, redirect, issuer).await?;
// a client built with Client::new, or a provider that is not discovered
let mut client: Client<_> = Client::new(provider, id, secret, redirect, http_client, jwks);
client.allow_insecure_endpoints();
// the standalone JWK set helper
let jwks = openid::jwks_insecure(&http_client, url).await?;discover, discover_with_client, discover_uma2 and uma2::discover_uma2 keep their signatures and simply require https.
Fixes
- Discovery url with a doubled slash (#105). An issuer with a path component and a trailing slash, e.g.
https://example.com/oidc/, requestedhttps://example.com/oidc//.well-known/openid-configurationand got a 404. Dropping the trailing slash was no workaround, because the discovered issuer is validated against the requested one. OpenID Connect Discovery 1.0 §4.1 and RFC 8414 §3.1 require the terminating/to be removed before appending. - Same bug in UMA2 discovery (#106).
/auth/realms/test//.well-known/uma2-configurationis fixed the same way, through one sharedwell_known_urlhelper. discover_uma2ignored the response status (#110). A 404 or 500 surfaced asexpected value at line 1 column 1, or as a confusing issuer mismatch. It now reportsError::Httpwith the status and url.
Notes
- The url construction moved into a sync
well_known_urlhelper, and the userinfo/introspection endpoints into small sync helpers, so they are unit tested without an async runtime. 34 lib tests. ../openid-examplesis bumped to thev0.26branch and builds against this release.