Bump version to 24.04.3.4
[LibreOffice.git] / ucb / source / ucp / cmis / auth_provider.hxx
blobaf1a420c26f28056115e2cf57a134bad17c29674
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #pragma once
11 #include <libcmis/libcmis.hxx>
13 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
14 #include <cppuhelper/weakref.hxx>
16 namespace cmis
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;
22 OUString m_sUrl;
23 OUString m_sBindingUrl;
25 public:
26 AuthProvider ( const css::uno::Reference< css::ucb::XCommandEnvironment> & xEnv,
27 OUString sUrl,
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: */