From c4fd9c93a63bce7c322aec1fc304b4dc5ac5a9cd Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 2 Jun 2025 10:12:34 +0200 Subject: Split authentication and authorization --- testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs') diff --git a/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs b/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs index 05d0af9..4d81b52 100644 --- a/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs +++ b/testFrontend/SafeNSound.Sdk/SafeNSoundClient.cs @@ -12,6 +12,14 @@ public class SafeNSoundClient(SafeNSoundConfiguration config, string accessToken Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken) } }; + + public async Task WhoAmI() + { + var res = await HttpClient.GetAsync("/auth/whoami"); + res.EnsureSuccessStatusCode(); + return (await res.Content.ReadFromJsonAsync())!; + } + #region Alarm public async Task GetAlarm(string userId = "@me") { -- cgit 1.5.1