GUACAMOLE-2210: Add support for AAD authentication to RDP protocol.#633
GUACAMOLE-2210: Add support for AAD authentication to RDP protocol.#633aleitner wants to merge 1 commit into
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 |
| /** | ||
| * User-Agent string sent with all HTTP requests to Microsoft login endpoints. | ||
| * A browser-like UA is required to avoid "unsupported browser" responses. | ||
| */ | ||
| #define GUAC_AAD_USER_AGENT \ | ||
| "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 " \ | ||
| "(KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" |
There was a problem hiding this comment.
Are we going to need to continually update this value to avoid being re-flagged as unsupported due to the claimed version being old?
There was a problem hiding this comment.
Not sure if this is an insane idea ... but we could calculate the expected current Chrome release from the current date based on their published major release cadence ...
There was a problem hiding this comment.
Microsoft's endpoints don't appear to validate browser version freshness currently. On the other hand we could fetch the latest stable major version from Google's VersionHistory API:
https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions
There was a problem hiding this comment.
Made the changes to get the latest chrome version!
There was a problem hiding this comment.
Unfortunately, phoning Google from within guacd is going to be a privacy issue. I don't think we can go this route.
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 |
29c3e67 to
685437e
Compare
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. |
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