Conversation
|
Didn't realize we don't have curl. This would require adding curl as a dependency |
14d083e to
ff25596
Compare
necouchman
left a comment
There was a problem hiding this comment.
Looks like the build is failing with an error about the switch() statement and one of the enums.
ff25596 to
de377cf
Compare
Ahh whoops! I was testing with only freerdp3 as that's when AAD support was implemented. Just added a case to the switch for freerdp2 so that it errors if AAD is selected |
7989a72 to
37b1d5a
Compare
necouchman
left a comment
There was a problem hiding this comment.
A few comments/changes. Also, generally:
- It seems like there might be a couple of opportunities for reusing code by creating a couple of new functions?
- Some of the documentation within the code is a bit sparse and could use a little more building out.
|
Also fixed two runtime issues from changes Microsoft made to the AAD login flow. The credential POST field name needs to be flowToken (camelCase) per |
685437e to
eb58713
Compare
|
This has been reworked from the original login-page automation to the OAuth2 device authorization grant (RFC 8628), so the user signs in on a separate device via a QR code and no credentials pass through Guacamole. |
eb58713 to
954e72d
Compare
954e72d to
b91cf82
Compare
| * not held open. */ | ||
| guac_stream* stream = guac_client_alloc_stream(client); | ||
| if (stream == NULL) { | ||
| guac_client_log(client, GUAC_LOG_DEBUG, |
There was a problem hiding this comment.
Should this be a warning?
There was a problem hiding this comment.
Made it a warning.
| guac_client_log(client, GUAC_LOG_DEBUG, | ||
| "AAD: Failed to send the sign-in prompt"); | ||
|
|
||
| guac_client_free_stream(client, stream); |
There was a problem hiding this comment.
If guac_protocol_send_pipe() succeeds, but guac_protocol_send_blob() fails, send & flush?
There was a problem hiding this comment.
Reworked so end and flush always run once the pipe is open, even if the blob send fails.
| /* Store the prompt so users who join or reconnect while sign-in is pending | ||
| * are brought up to date, then show it to the current owner */ | ||
| char* body = guac_rdp_aad_build_prompt_json(dc); | ||
| if (body != NULL) { |
There was a problem hiding this comment.
Log a warning if body == NULL?
There was a problem hiding this comment.
Added a warning on the null path.
| /* Sleep in short slices so a disconnect is noticed within ~1s rather | ||
| * than after the full polling interval */ | ||
| for (int i = 0; i < interval && client->state == GUAC_CLIENT_RUNNING; i++) | ||
| sleep(1); |
There was a problem hiding this comment.
In for (int i loop, maybe check for time(NULL) < deadline and guac_client_for_owner(client, guac_rdp_aad_owner_present, NULL), like in the while loop?
There was a problem hiding this comment.
Added the deadline and owner checks to the sleep loop too.
b91cf82 to
b34a98d
Compare
AadSecuritymodeAuthentication flow
When
security=aadis set on an RDP connection:GetAccessTokencallback with the requested scope and a Proof-of-Possession key confirmation (req_cnf).grant_type=urn:ietf:params:oauth:grant-type:device_code) while the user authenticates on their own device, forwardingreq_cnfso Azure issues a Proof-of-Possession token. Polling honors the server-provided interval andslow_down, and stops if the connection closes or the code expires.Configuration
New RDP parameters:
aad-client-id(required for AAD) is the Azure AD application (client) ID to authenticate as. The app must have public client flows enabled so it can use the device code grant.aad-scope(optional) is the OAuth2 scope to request. If omitted, the scope FreeRDP derives for the target host is used.aad-tenant-id(optional) is the Azure AD tenant, defaulting toorganizations.Notes
HAVE_FREERDP_AAD_SUPPORT(FreeRDP built with AAD) and the presence of libcurl. If either is unavailable it compiles out cleanly, and non-AAD RDP is unaffected.Paired with apache/guacamole-client#1168