mirror of
https://github.com/openharmony/useriam_user_auth.git
synced 2026-07-19 14:23:34 -04:00
@@ -121,7 +121,8 @@ void UserAuthNative::GetProperty(const GetPropertyRequest &request, std::shared_
|
||||
proxy->GetProperty(request, asyncStub);
|
||||
}
|
||||
|
||||
void UserAuthNative::GetProperty(const int32_t userId, const GetPropertyRequest &request, std::shared_ptr<GetPropCallback> callback)
|
||||
void UserAuthNative::GetProperty(const int32_t userId, const GetPropertyRequest &request,
|
||||
std::shared_ptr<GetPropCallback> callback)
|
||||
{
|
||||
USERAUTH_HILOGD(MODULE_INNERKIT, "GetProperty start");
|
||||
if (callback == nullptr) {
|
||||
|
||||
@@ -90,7 +90,8 @@ void UserAuthProxy::GetProperty(const GetPropertyRequest request, sptr<IUserAuth
|
||||
}
|
||||
}
|
||||
|
||||
void UserAuthProxy::GetProperty(const int32_t userId, const GetPropertyRequest request, sptr<IUserAuthCallback> &callback)
|
||||
void UserAuthProxy::GetProperty(const int32_t userId, const GetPropertyRequest request,
|
||||
sptr<IUserAuthCallback> &callback)
|
||||
{
|
||||
USERAUTH_HILOGD(MODULE_INNERKIT, "UserAuthProxy GetProperty start");
|
||||
MessageParcel data;
|
||||
|
||||
@@ -14,12 +14,10 @@
|
||||
*/
|
||||
|
||||
#include "userauth.h"
|
||||
#include "user_auth.h"
|
||||
#include <cinttypes>
|
||||
#include <if_system_ability_manager.h>
|
||||
#include <iservice_registry.h>
|
||||
#include <sstream>
|
||||
#include <system_ability_definition.h>
|
||||
#include "user_auth.h"
|
||||
#include "system_ability_definition.h"
|
||||
#include "userauth_hilog_wrapper.h"
|
||||
|
||||
@@ -29,7 +27,8 @@ namespace UserAuth {
|
||||
UserAuth::UserAuth() = default;
|
||||
UserAuth::~UserAuth() = default;
|
||||
|
||||
void UserAuth::GetProperty(const int32_t userId, const GetPropertyRequest &request, std::shared_ptr<GetPropCallback> callback)
|
||||
void UserAuth::GetProperty(const int32_t userId, const GetPropertyRequest &request,
|
||||
std::shared_ptr<GetPropCallback> callback)
|
||||
{
|
||||
USERAUTH_HILOGD(MODULE_INNERAPI, "GetProperty start");
|
||||
if (callback == nullptr) {
|
||||
@@ -40,7 +39,8 @@ void UserAuth::GetProperty(const int32_t userId, const GetPropertyRequest &reque
|
||||
UserAuthNative::GetInstance().GetProperty(userId, request, callback);
|
||||
}
|
||||
|
||||
void UserAuth::SetProperty(const int32_t userId, const SetPropertyRequest &request, std::shared_ptr<SetPropCallback> callback)
|
||||
void UserAuth::SetProperty(const int32_t userId, const SetPropertyRequest &request,
|
||||
std::shared_ptr<SetPropCallback> callback)
|
||||
{
|
||||
static_cast<void>(userId);
|
||||
USERAUTH_HILOGD(MODULE_INNERAPI, "SetProperty start");
|
||||
@@ -61,7 +61,6 @@ uint64_t UserAuth::AuthUser(const int32_t userId, const uint64_t challenge, cons
|
||||
return INVALID_PARAMETERS;
|
||||
}
|
||||
uint64_t ret = UserAuthNative::GetInstance().AuthUser(userId, challenge, authType, authTrustLevel, callback);
|
||||
USERAUTH_HILOGI(MODULE_INNERAPI, "AuthUser result %{public}llu", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -69,10 +68,8 @@ int32_t UserAuth::CancelAuth(const uint64_t contextId)
|
||||
{
|
||||
USERAUTH_HILOGD(MODULE_INNERAPI, "CancelAuth start");
|
||||
uint32_t ret = UserAuthNative::GetInstance().CancelAuth(contextId);
|
||||
USERAUTH_HILOGI(MODULE_INNERAPI, "CancelAuth result %{public}u", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace UserAuth
|
||||
} // namespace UserIAM
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -44,8 +44,6 @@ enum ResultCode : int32_t {
|
||||
E_CHECK_PERMISSION_FAILED = 18,
|
||||
ERRORCODE_MAX = 19
|
||||
};
|
||||
|
||||
|
||||
} // namespace UserAuth
|
||||
} // namespace UserIAM
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -31,8 +31,10 @@ class UserAuth : public DelayedRefSingleton<UserAuth> {
|
||||
public:
|
||||
DISALLOW_COPY_AND_MOVE(UserAuth);
|
||||
|
||||
void GetProperty(const int32_t userId, const GetPropertyRequest &request, std::shared_ptr<GetPropCallback> callback);
|
||||
void SetProperty(const int32_t userId, const SetPropertyRequest &request, std::shared_ptr<SetPropCallback> callback);
|
||||
void GetProperty(const int32_t userId, const GetPropertyRequest &request,
|
||||
std::shared_ptr<GetPropCallback> callback);
|
||||
void SetProperty(const int32_t userId, const SetPropertyRequest &request,
|
||||
std::shared_ptr<SetPropCallback> callback);
|
||||
uint64_t AuthUser(const int32_t userId, const uint64_t challenge, const AuthType authType,
|
||||
const AuthTrustLevel authTrustLevel, std::shared_ptr<UserAuthCallback> callback);
|
||||
int32_t CancelAuth(const uint64_t contextId);
|
||||
|
||||
@@ -584,7 +584,8 @@ napi_value UserAuthImpl::AuthWrap(napi_env env, AuthInfo *authInfo)
|
||||
callback.reset(object);
|
||||
uint64_t result = UserAuthNative::GetInstance().Auth(authInfo->challenge, AuthType(authInfo->authType),
|
||||
AuthTrustLevel(authInfo->authTrustLevel), callback);
|
||||
USERAUTH_HILOGI(MODULE_JS_NAPI, "UserAuthNative::GetInstance().Auth result = 0xXXXX%{public}04" PRIx64 "", MASK & result);
|
||||
USERAUTH_HILOGI(MODULE_JS_NAPI, "UserAuthNative::GetInstance().Auth result = 0xXXXX%{public}04" PRIx64 "",
|
||||
MASK & result);
|
||||
napi_value key = authBuild.Uint64ToUint8Array(env, result);
|
||||
USERAUTH_HILOGI(MODULE_JS_NAPI, "%{public}s end", __func__);
|
||||
return key;
|
||||
|
||||
@@ -20,7 +20,7 @@ config("userauth_private_config") {
|
||||
|
||||
config("userauth_public_config") {
|
||||
include_dirs = [
|
||||
"include" ,
|
||||
"include",
|
||||
"../../inner_api/include/common",
|
||||
"../../inner_api/include/userauth",
|
||||
"../../inner_api/include/useridm",
|
||||
|
||||
@@ -64,7 +64,8 @@ public:
|
||||
* param request the attribute field list, authentication credential type, and credential information.
|
||||
* param callback the authentication result code is returned through the callback.
|
||||
*/
|
||||
virtual void GetProperty(const int32_t userId, const GetPropertyRequest request, sptr<IUserAuthCallback> &callback) = 0;
|
||||
virtual void GetProperty(const int32_t userId, const GetPropertyRequest request,
|
||||
sptr<IUserAuthCallback> &callback) = 0;
|
||||
|
||||
/*
|
||||
* set properties: can be used to initialize algorithms.
|
||||
|
||||
@@ -31,7 +31,8 @@ public:
|
||||
|
||||
int32_t GetAvailableStatus(const AuthType authType, const AuthTrustLevel authTrustLevel) override;
|
||||
void GetProperty(const GetPropertyRequest request, sptr<IUserAuthCallback> &callback) override;
|
||||
void GetProperty(const int32_t userId, const GetPropertyRequest request, sptr<IUserAuthCallback> &callback) override;
|
||||
void GetProperty(const int32_t userId, const GetPropertyRequest request,
|
||||
sptr<IUserAuthCallback> &callback) override;
|
||||
void SetProperty(const SetPropertyRequest request, sptr<IUserAuthCallback> &callback) override;
|
||||
uint64_t Auth(const uint64_t challenge, const AuthType authType, const AuthTrustLevel authTrustLevel,
|
||||
sptr<IUserAuthCallback> &callback) override;
|
||||
|
||||
@@ -38,7 +38,8 @@ public:
|
||||
void OnStop() override;
|
||||
int32_t GetAvailableStatus(const AuthType authType, const AuthTrustLevel authTrustLevel) override;
|
||||
void GetProperty(const GetPropertyRequest request, sptr<IUserAuthCallback> &callback) override;
|
||||
void GetProperty(const int32_t userId, const GetPropertyRequest request, sptr<IUserAuthCallback> &callback) override;
|
||||
void GetProperty(const int32_t userId, const GetPropertyRequest request,
|
||||
sptr<IUserAuthCallback> &callback) override;
|
||||
void SetProperty(const SetPropertyRequest request, sptr<IUserAuthCallback> &callback) override;
|
||||
uint64_t Auth(const uint64_t challenge, const AuthType authType, const AuthTrustLevel authTrustLevel,
|
||||
sptr<IUserAuthCallback> &callback) override;
|
||||
|
||||
@@ -158,7 +158,8 @@ void UserAuthService::GetProperty(const GetPropertyRequest request, sptr<IUserAu
|
||||
userAuthController_.GetPropAuthInfo(ids[firstAccountIndex], callerName, callerId, request, callback);
|
||||
}
|
||||
|
||||
void UserAuthService::GetProperty(const int32_t userId, const GetPropertyRequest request, sptr<IUserAuthCallback> &callback)
|
||||
void UserAuthService::GetProperty(const int32_t userId, const GetPropertyRequest request,
|
||||
sptr<IUserAuthCallback> &callback)
|
||||
{
|
||||
USERAUTH_HILOGI(MODULE_SERVICE, "UserAuthService GetProperty start");
|
||||
std::string callerName;
|
||||
|
||||
Reference in New Issue
Block a user