Created
July 10, 2024 16:12
-
-
Save dmulder/cf09cc56fa5667279a3f4e5cfe3928fb to your computer and use it in GitHub Desktop.
A simple test dbus extension that should respond to requests for the MS Identity Broker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::error::Error; | |
use std::future::pending; | |
use zbus::{connection, interface}; | |
pub struct Broker; | |
#[interface(name = "com.microsoft.identity.broker1")] | |
impl Broker { | |
#[allow(non_snake_case)] | |
fn getAccounts(&mut self, num: f32, session_id: &str, context: &str) -> String { | |
println!("get_accounts: {}, {}, {}", num, session_id, context); | |
"".to_string() | |
} | |
#[allow(non_snake_case)] | |
fn acquirePrtSsoCookie(&mut self, num: f32, session_id: &str, request: &str) -> String { | |
println!("acquire_prt_sso_cookie: {}, {}, {}", num, session_id, request); | |
"".to_string() | |
} | |
#[allow(non_snake_case)] | |
fn acquireTokenSilently(&mut self, num: f32, session_id: &str, request: &str) -> String { | |
println!("acquire_token_silently: {}, {}, {}", num, session_id, request); | |
"".to_string() | |
} | |
} | |
#[tokio::main] | |
async fn main() -> Result<(), Box<dyn Error>> { | |
let broker = Broker { }; | |
let _conn = connection::Builder::session()? | |
.name("com.microsoft.identity.broker1")? | |
.serve_at("/com/microsoft/identity/broker1", broker)? | |
.build() | |
.await?; | |
pending::<()>().await; | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment