diff options
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/auth_provider.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/ucb/source/ucp/cmis/auth_provider.cxx b/ucb/source/ucp/cmis/auth_provider.cxx index f9eb99db2553..dd7b4f9f1e3c 100644 --- a/ucb/source/ucp/cmis/auth_provider.cxx +++ b/ucb/source/ucp/cmis/auth_provider.cxx @@ -96,7 +96,7 @@ namespace cmis "Open the following link in your browser and " "paste the code from the URL you have been redirected to in the " "box below. For example:\n" - "https://login.live.com/oauth20_desktop.srf?code=YOUR_CODE&lc=1033", + "http://localhost/LibreOffice?code=YOUR_CODE", url_oustr ); xIH->handle( xRequest.get() ); diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 14cdb1bbddc7..60bd54b722ec 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -346,11 +346,20 @@ namespace cmis string rUsername = OUSTR_TO_STDSTR( m_aURL.getUsername( ) ); string rPassword = OUSTR_TO_STDSTR( m_aURL.getPassword( ) ); + bool bSkipInitialPWAuth = false; + if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL ) { + // skip the initial username and pw-auth prompt, the only supported method is the + // auth-code-fallback one (login with your browser, copy code into the dialog) + // TODO: if LO were to listen on localhost for the request, it would be much nicer + // user experience + bSkipInitialPWAuth = true; + } + bool bIsDone = false; while ( !bIsDone ) { - if (aAuthProvider.authenticationQuery(rUsername, rPassword)) + if (bSkipInitialPWAuth || aAuthProvider.authenticationQuery(rUsername, rPassword)) { // Initiate a CMIS session and register it as we found nothing libcmis::OAuth2DataPtr oauth2Data; @@ -369,6 +378,8 @@ namespace cmis ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) ); if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL ) { + // reset the skip, so user gets a chance to cancel + bSkipInitialPWAuth = false; libcmis::SessionFactory::setOAuth2AuthCodeProvider(AuthProvider::onedriveAuthCodeFallback); oauth2Data.reset( new libcmis::OAuth2Data( ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL, |