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 #include <libcmis/libcmis.hxx>
13 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
14 #include <cppuhelper/weakref.hxx>
18 class AuthProvider
: public libcmis::AuthProvider
20 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& m_xEnv
;
21 static css::uno::WeakReference
< css::ucb::XCommandEnvironment
> sm_xEnv
;
23 OUString m_sBindingUrl
;
26 AuthProvider ( const css::uno::Reference
< css::ucb::XCommandEnvironment
> & xEnv
,
28 OUString sBindingUrl
):
29 m_xEnv( xEnv
), m_sUrl( std::move(sUrl
) ), m_sBindingUrl( std::move(sBindingUrl
) ) { }
31 bool authenticationQuery( std::string
& username
, std::string
& password
) override
;
33 std::string
getRefreshToken( std::string
& username
);
34 bool storeRefreshToken(const std::string
& username
, const std::string
& password
,
35 const std::string
& refreshToken
);
37 static char* copyWebAuthCodeFallback( const char* url
,
38 const char* /*username*/,
39 const char* /*password*/ );
41 static void setXEnv( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
);
42 static css::uno::Reference
< css::ucb::XCommandEnvironment
> getXEnv();
47 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */