1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #if defined __GNUC__ && !defined __clang__
12 #pragma GCC diagnostic push
13 #pragma GCC diagnostic ignored "-Wdeprecated"
14 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
16 #include <libcmis/libcmis.hxx>
17 #if defined __GNUC__ && !defined __clang__
18 #pragma GCC diagnostic pop
21 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
22 #include <cppuhelper/weakref.hxx>
26 class AuthProvider
: public libcmis::AuthProvider
28 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& m_xEnv
;
29 static css::uno::WeakReference
< css::ucb::XCommandEnvironment
> sm_xEnv
;
31 OUString m_sBindingUrl
;
34 AuthProvider ( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
,
36 const OUString
& sBindingUrl
):
37 m_xEnv( xEnv
), m_sUrl( sUrl
), m_sBindingUrl( sBindingUrl
) { }
39 bool authenticationQuery( std::string
& username
, std::string
& password
) override
;
41 std::string
getRefreshToken( std::string
& username
);
42 bool storeRefreshToken(const std::string
& username
, const std::string
& password
,
43 const std::string
& refreshToken
);
45 static char* copyWebAuthCodeFallback( const char* url
,
46 const char* /*username*/,
47 const char* /*password*/ );
49 static void setXEnv( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
);
50 static css::uno::Reference
< css::ucb::XCommandEnvironment
> getXEnv();
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */