1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OS_ACCOUNT_INTERFACES_INNERKITS_DOMAIN_ACCOUNT_INCLUDE_DOMAIN_ACCOUNT_PLUGIN_H 17 #define OS_ACCOUNT_INTERFACES_INNERKITS_DOMAIN_ACCOUNT_INCLUDE_DOMAIN_ACCOUNT_PLUGIN_H 18 19 #include "os_account_info.h" 20 #include "domain_auth_callback.h" 21 22 namespace OHOS { 23 namespace AccountSA { 24 class DomainAccountPlugin { 25 public: 26 /** 27 * Authenticates the specified domain account with the specified password, 28 * the authentication result should be returned from the callback. 29 * 30 * @param info Indicates the domain account information, including accountName and domain. 31 * @param password Indicates the password for authentication. 32 * @param callback Indicates the result callback. 33 */ 34 virtual void Auth(const DomainAccountInfo &info, const std::vector<uint8_t> &password, 35 const std::shared_ptr<DomainAuthCallback> &callback) = 0; 36 37 /** 38 * Gets the authentication property of the specified domain account, 39 * which can be used to prevent brute-force attack. 40 * 41 * @param info Indicates the domain account information, including accountName and domain. 42 * @param[out] property Indicates the authentication property, including remaining times and freezing time. 43 * @return 0 indicates success, others indicate failure. 44 */ 45 virtual int32_t GetAuthProperty(const DomainAccountInfo &info, DomainAuthProperty &property) = 0; 46 }; 47 } // namespace AccountSA 48 } // namespace OHOS 49 #endif // OS_ACCOUNT_INTERFACES_INNERKITS_DOMAIN_ACCOUNT_INCLUDE_DOMAIN_ACCOUNT_PLUGIN_H