Skip to content

Release v0.26.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Nov 17:16
· 3 commits to master since this release

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 http with Error::Insecure or the new ClientError::Insecure. Before this release only the JWK set fetch was checked. Two docstrings already promised Error::Insecure for userinfo and introspection; they now do.
  • ClientError::Insecure(url::Url) added, so an exhaustive match on ClientError needs 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/, requested https://example.com/oidc//.well-known/openid-configuration and 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-configuration is fixed the same way, through one shared well_known_url helper.
  • discover_uma2 ignored the response status (#110). A 404 or 500 surfaced as expected value at line 1 column 1, or as a confusing issuer mismatch. It now reports Error::Http with the status and url.

Notes

  • The url construction moved into a sync well_known_url helper, and the userinfo/introspection endpoints into small sync helpers, so they are unit tested without an async runtime. 34 lib tests.
  • ../openid-examples is bumped to the v0.26 branch and builds against this release.