Files
odfstudio/uui/Library_uui.mk
T
Mike Kaganski 964bcfa287 tdf#101630: Use redirect URL for browser-based OAuth2
To interact with an OAuth2 provider, we must open a browser with the
URL of the provider, and in that URL encode our target URL to use to
send information about the result of authentication (either failure,
or the access tokens).

The target URL can either be an HTTP URL, or a custom URI scheme [1].
The custom scheme looks attractive, because it doesn't need to listen
to HTTP, and would receive the data through command line arguments.
However, this technique requires to register a custom URI handler on
the system; and that can't be done temporarily, for the current app,
on some platforms; so if we decided to use the custom URI scheme, it
would only work for installed app, not for portable one.

Using HTTP URL, it can be either an external one (which would require
to run an online service for authentication, which would receive the
data from OAuth2 providers, and then communicate it to the app that
requested it - with all kinds of security implications), or it can be
a loopback URL to a local HTTP server. The latter option has no HTTPS
requirement (the sensitive data is sent through HTTP locally, never
leaving the host; the problem with HTTPS is that we would need a cert
for the local system, trusted by browsers); that is implemented here:
a local server is established by the app itself, before sending the
auth request.

This change only provides implementation for Windows. To have a cross-
platform solution, another HTTP server implementation is needed, e.g.
using boost/beast.

This also removes password prompt from the File Services dialog for
Google Drive and OneDrive, when the new method is implemented (i.e.,
currently only on Windows).

[1] https://www.oauth.com/oauth2-servers/oauth-native-apps/redirect-urls-for-native-apps/

Change-Id: I4684477c73a54370721e700fa95fc5f14344cf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192253
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-10-26 16:54:25 +01:00

76 lines
1.8 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Library_Library,uui))
$(eval $(call gb_Library_set_include,uui,\
$$(INCLUDE) \
-I$(SRCDIR)/uui/inc \
))
$(eval $(call gb_Library_set_componentfile,uui,uui/util/uui,services))
$(eval $(call gb_Library_use_external,uui,boost_headers))
$(eval $(call gb_Library_use_external,uui,curl))
$(eval $(call gb_Library_use_custom_headers,uui,\
officecfg/registry \
))
$(eval $(call gb_Library_set_precompiled_header,uui,uui/inc/pch/precompiled_uui))
$(eval $(call gb_Library_use_sdk_api,uui))
$(eval $(call gb_Library_use_libraries,uui,\
comphelper \
cppu \
cppuhelper \
sal \
i18nlangtag \
svl \
svt \
svx \
tl \
utl \
vcl \
))
$(eval $(call gb_Library_add_exception_objects,uui,\
uui/source/alreadyopen \
uui/source/authfallbackdlg \
uui/source/filechanged \
uui/source/fltdlg \
uui/source/iahndl \
uui/source/iahndl-authentication \
uui/source/iahndl-errorhandler \
uui/source/iahndl-filter \
uui/source/iahndl-ioexceptions \
uui/source/iahndl-locking \
$(if $(filter MSC,$(COM)),uui/source/iahndl-oauth2-win) \
uui/source/iahndl-ssl \
uui/source/interactionhandler \
uui/source/lockfailed \
uui/source/lockcorrupt \
uui/source/logindlg \
uui/source/masterpasscrtdlg \
uui/source/masterpassworddlg \
uui/source/nameclashdlg \
uui/source/openlocked \
uui/source/passwordcontainer \
uui/source/passworddlg \
uui/source/reloadeditable \
uui/source/requeststringresolver \
uui/source/secmacrowarnings \
uui/source/sslwarndlg \
uui/source/trylater \
uui/source/unknownauthdlg \
))
# vim: set noet sw=4 ts=4: