nss: upgrade to release 3.73
[LibreOffice.git] / ucb / source / ucp / cmis / auth_provider.hxx
blob462f7edba54d8766449b5636bdf4536abac0ddf6
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 #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX
10 #define INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX
12 #if defined __GNUC__ && !defined __clang__
13 #pragma GCC diagnostic push
14 #pragma GCC diagnostic ignored "-Wdeprecated"
15 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
16 #endif
17 #include <libcmis/libcmis.hxx>
18 #if defined __GNUC__ && !defined __clang__
19 #pragma GCC diagnostic pop
20 #endif
22 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
23 #include <cppuhelper/weakref.hxx>
25 namespace cmis
27 class AuthProvider : public libcmis::AuthProvider
29 const css::uno::Reference< css::ucb::XCommandEnvironment>& m_xEnv;
30 static css::uno::WeakReference< css::ucb::XCommandEnvironment> sm_xEnv;
31 OUString m_sUrl;
32 OUString m_sBindingUrl;
34 public:
35 AuthProvider ( const css::uno::Reference< css::ucb::XCommandEnvironment>& xEnv,
36 const OUString& sUrl,
37 const OUString& sBindingUrl ):
38 m_xEnv( xEnv ), m_sUrl( sUrl ), m_sBindingUrl( sBindingUrl ) { }
40 bool authenticationQuery( std::string& username, std::string& password ) override;
42 std::string getRefreshToken( std::string& username );
43 bool storeRefreshToken(const std::string& username, const std::string& password,
44 const std::string& refreshToken);
46 static char* copyWebAuthCodeFallback( const char* url,
47 const char* /*username*/,
48 const char* /*password*/ );
50 static void setXEnv( const css::uno::Reference< css::ucb::XCommandEnvironment>& xEnv );
51 static css::uno::Reference< css::ucb::XCommandEnvironment> getXEnv();
56 #endif
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */