summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host/config_oauth2.h.in10
-rw-r--r--configure.ac33
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu2
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx6
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx5
-rw-r--r--ucb/source/ucp/cmis/cmis_repo_content.cxx5
6 files changed, 60 insertions, 1 deletions
diff --git a/config_host/config_oauth2.h.in b/config_host/config_oauth2.h.in
index 40c57a871a92..72c19a8aa670 100644
--- a/config_host/config_oauth2.h.in
+++ b/config_host/config_oauth2.h.in
@@ -33,6 +33,16 @@
#define ALFRESCO_CLOUD_REDIRECT_URI "http://127.0.0.1/Callback"
#define ALFRESCO_CLOUD_SCOPE "public_api"
+
+/* OneDrive */
+#define ONEDRIVE_BASE_URL "https://apis.live.net/v5.0"
+#define ONEDRIVE_CLIENT_ID ""
+#define ONEDRIVE_CLIENT_SECRET ""
+#define ONEDRIVE_AUTH_URL "https://login.live.com/oauth20_authorize.srf"
+#define ONEDRIVE_TOKEN_URL "https://login.live.com/oauth20_token.srf"
+#define ONEDRIVE_REDIRECT_URI "https://login.live.com/oauth20_desktop.srf"
+#define ONEDRIVE_SCOPE "wl.offline_access"
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configure.ac b/configure.ac
index 72ef58c523e0..c1adcfaf4834 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2225,6 +2225,19 @@ AC_ARG_WITH(alfresco-cloud-client-secret,
--with-alfresco-cloud-client-id is empty, the feature will be disabled]),
)
+AC_ARG_WITH(onedrive-client-id,
+ AS_HELP_STRING([--with-onedrive-client-id],
+ [Provides the client id of the application for OAuth2 authentication
+ on OneDrive. If either this or --with-onedrive-client-secret is
+ empty, the feature will be disabled]),
+)
+
+AC_ARG_WITH(onedrive-client-secret,
+ AS_HELP_STRING([--with-onedrive-client-secret],
+ [Provides the client secret of the application for OAuth2
+ authentication on OneDrive. If either this or
+ --with-onedrive-client-id is empty, the feature will be disabled]),
+)
dnl ===================================================================
dnl Do we want to use pre-build binary tarball for recompile
dnl ===================================================================
@@ -12361,6 +12374,26 @@ fi
AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
+AC_MSG_CHECKING([for OneDrive client id and secret])
+ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
+ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
+if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
+ ONEDRIVE_CLIENT_ID="\"\""
+fi
+
+if test "$with_onedrive_client_secret" = "no" -o -z "$with_onedrive_client_secret"; then
+ ONEDRIVE_CLIENT_SECRET="\"\""
+fi
+
+if test -z "$ONEDRIVE_CLIENT_ID" -o -z "$ONEDRIVE_CLIENT_SECRET"; then
+ AC_MSG_RESULT([not set])
+else
+ AC_MSG_RESULT([set])
+fi
+AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
+AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
+
+
# ===================================================================
# De- or increase default verbosity of build process
# ===================================================================
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 6cd4e22da7a8..fd51b4bd3b0e 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -580,6 +580,7 @@
<it>http://ec2-184-72-233-127.compute-1.amazonaws.com/ot-cmis/services/RepositoryService?wsdl</it>
<it>http://&lt;host&gt;/_vti_bin/CMISSoapwsdl.aspx</it>
<it>https://www.googleapis.com/drive/v2</it>
+ <it>https://apis.live.net/v5.0</it>
</value>
</prop>
<prop oor:name="CmisServersNames">
@@ -594,6 +595,7 @@
<it>OpenText ELS 10.2.0</it>
<it>SharePoint 2010</it>
<it>Google Drive</it>
+ <it>OneDrive</it>
</value>
</prop>
</node>
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 4bc907c1efba..1c723565b778 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -283,6 +283,9 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
OUString( GDRIVE_CLIENT_SECRET ).isEmpty();
bool bSkipAlfresco = OUString( ALFRESCO_CLOUD_CLIENT_ID ).isEmpty() ||
OUString( ALFRESCO_CLOUD_CLIENT_SECRET ).isEmpty();
+ bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() ||
+ OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty();
+
Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
@@ -290,7 +293,8 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
{
OUString sUrl = aTypesUrlsList[i];
if ( !( sUrl == GDRIVE_BASE_URL && bSkipGDrive ) &&
- !( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) )
+ !( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) &&
+ !( sUrl == ONEDRIVE_BASE_URL && bSkipOneDrive ) )
{
m_pLBServerType->InsertEntry( aTypesNamesList[i] );
m_aServerTypesURLs.push_back( sUrl );
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 08d01a882640..ad9fda424052 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -353,6 +353,11 @@ namespace cmis
ALFRESCO_CLOUD_AUTH_URL, ALFRESCO_CLOUD_TOKEN_URL,
ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI,
ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) );
+ if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL )
+ oauth2Data.reset( new libcmis::OAuth2Data(
+ ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL,
+ ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI,
+ ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) );
m_pSession = libcmis::SessionFactory::createSession(
OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ),
diff --git a/ucb/source/ucp/cmis/cmis_repo_content.cxx b/ucb/source/ucp/cmis/cmis_repo_content.cxx
index 5dc1ae1ceda5..bb31b84c79ee 100644
--- a/ucb/source/ucp/cmis/cmis_repo_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_repo_content.cxx
@@ -178,6 +178,11 @@ namespace cmis
ALFRESCO_CLOUD_AUTH_URL, ALFRESCO_CLOUD_TOKEN_URL,
ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI,
ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) );
+ if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL )
+ oauth2Data.reset( new libcmis::OAuth2Data(
+ ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL,
+ ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI,
+ ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) );
boost::scoped_ptr<libcmis::Session> session(libcmis::SessionFactory::createSession(
OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ),