aleitner commented on code in PR #633:
URL: https://github.com/apache/guacamole-server/pull/633#discussion_r3198296586


##########
src/protocols/rdp/rdp.c:
##########
@@ -327,6 +328,149 @@ static BOOL rdp_freerdp_authenticate(freerdp* instance, 
char** username,
 
 }
 
+#ifdef HAVE_FREERDP_AAD_SUPPORT
+#include "aad.h"
+
+/**
+ * Callback invoked by FreeRDP when an Azure AD access token is required.
+ *
+ * @param instance
+ *     The FreeRDP instance associated with the RDP session.
+ *
+ * @param tokenType
+ *     The type of access token being requested (ACCESS_TOKEN_TYPE_AAD or
+ *     ACCESS_TOKEN_TYPE_AVD).
+ *
+ * @param token
+ *     Pointer to a string which will receive the access token. This function
+ *     must allocate and populate this string.
+ *
+ * @param count
+ *     Number of additional variadic arguments.
+ *
+ * @param ...
+ *     Additional arguments (for AAD: scope and req_cnf)
+ *
+ * @return
+ *     TRUE if an access token was successfully obtained, FALSE otherwise.
+ */
+static BOOL rdp_freerdp_get_access_token(freerdp* instance,
+        AccessTokenType tokenType, char** token, size_t count, ...) {
+
+    rdpContext* context = GUAC_RDP_CONTEXT(instance);
+    guac_client* client = ((rdp_freerdp_context*) context)->client;
+    guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
+    guac_rdp_settings* settings = rdp_client->settings;
+
+    *token = NULL;
+
+    /* Only handle ACCESS_TOKEN_TYPE_AAD for now */
+    if (tokenType != ACCESS_TOKEN_TYPE_AAD) {
+        guac_client_log(client, GUAC_LOG_ERROR,
+            "AAD: Unsupported token type: %d", tokenType);

Review Comment:
   Rephrased to `"Unsupported access token type: %d (only AAD is supported)"`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to