feat(core): RDP client on IronRDP
clients::rdp connects over any caller-dialled TCP stream (direct, proxy or SSH tunnel), upgrades to TLS and logs on with NLA (CredSSP/NTLM), optionally falling back to TLS-only logon for servers without NLA such as xrdp (credentials are passed so they log straight in). The server certificate is pinned through a caller check on its SHA256 fingerprint before any credentials are sent. The desktop decodes into the VNC client's RGBA framebuffer; input (IronRDP's scancode/Unicode/mouse operations), Display Control resizes and the deactivation-reactivation sequence run on the session thread. IronRDP's releases need three vendored patches (vendor/README.md): picky and sspi with their RustCrypto release-candidate pins relaxed so they share russh's stable versions (their own suites, 402 tests, pass against them), and ironrdp-session with two unreleased upstream bitmap fixes (#1486 stride, #1524 RDP6 orientation) without which xrdp desktops render sheared. Verified live against xrdp (scottyhardy/docker-remote-desktop): logon, full desktop rendering, keyboard and mouse input.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace AADJoin.Messages
|
||||
{
|
||||
public class AuthResponse
|
||||
{
|
||||
public string token_type { get; set; }
|
||||
public string scope { get; set; }
|
||||
public string expires_in { get; set; }
|
||||
public string ext_expires_in { get; set; }
|
||||
public string expires_on { get; set; }
|
||||
public string not_before { get; set; }
|
||||
public string resource { get; set; }
|
||||
public string access_token { get; set; }
|
||||
public string refresh_token { get; set; }
|
||||
public string id_token { get; set; }
|
||||
|
||||
public static AuthResponse fromString(string authResponse)
|
||||
{
|
||||
return JsonSerializer.Deserialize<AuthResponse>(authResponse);
|
||||
}
|
||||
|
||||
public string GetTenantId()
|
||||
{
|
||||
var payload = id_token.Split('.')[1];
|
||||
switch (payload.Length % 4)
|
||||
{
|
||||
case 2: payload += "=="; break;
|
||||
case 3: payload += "="; break;
|
||||
}
|
||||
|
||||
var document = JsonDocument.Parse(Convert.FromBase64String(payload));
|
||||
var idToken = document.RootElement.GetProperty("tid");
|
||||
|
||||
return idToken.GetString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user