In 5.0, Client uses typestates to ensure required endpoints are configured before an auth flow is used. All endpoints are now optional.
1. Update Constructor
Use the single-argument Client::new(client_id) constructor. Use setters like set_auth_uri() or set_token_uri() to configure the client.
2. Handle Generic Parameters
If you store a BasicClient or Client in a custom data type, you must include the five endpoint typestate generic parameters. The possible states are:
EndpointNotSet: Endpoint is unavailable.EndpointSet: Endpoint is ready for use.EndpointMaybeSet: Endpoint can be used via fallible methods that return Err(ConfigurationError::MissingUrl(_)) (useful for dynamic discovery).
If using BasicClient, add these parameters:
HasAuthUrl, HasDeviceAuthUrl, HasIntrospectionUrl, HasRevocationUrl, HasTokenUrl.
// Example: Annotating a BasicClient with specific typestates
type MyClient = BasicClient<
EndpointSet, // HasAuthUrl
EndpointNotSet, // HasDeviceAuthUrl
EndpointNotSet, // HasIntrospectionUrl
EndpointNotSet, // HasRevocationUrl
EndpointSet, // HasTokenUrl
>;