Function example_oidc_cli::main

source ·
pub(crate) fn main() -> Result<()>
Expand description

A command-line tool to demonstrate the steps requiring an interaction with an OpenID Connect provider for a Matrix client, using the Authorization Code flow.

You can test this against one of the servers from the OIDC playground: https://github.com/element-hq/oidc-playground.

To use this, just run cargo run -p example-oidc-cli, and everything is interactive after that. You might want to set the RUST_LOG environment variable to warn to reduce the noise in the logs. The program exits whenever an unexpected error occurs.

To reset the login, simply use the logout command or delete the folder containing the session file, the location is shown in the logs. Note that the database must be deleted too as it can’t be reused.