openharmony 鸿蒙 arkts-basic-components-web-HttpAuthHandler

2026-08-25 浏览 (1)

Class (HttpAuthHandler)

Implements the HttpAuthHandler object. For details about the sample code, see onHttpAuthRequest.

NOTE

  • The initial APIs of this component are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.

  • The initial APIs of this class are supported since API version 9.

  • The sample effect is subject to the actual device.

constructor9+

constructor()

Constructs an HttpAuthHandler.

System capability: SystemCapability.Web.Webview.Core

cancel9+

cancel(): void

Cancels HTTP authentication as requested by the user.

System capability: SystemCapability.Web.Webview.Core

confirm9+

confirm(userName: string, password: string): boolean

Performs HTTP authentication with the user name and password provided by the user.

System capability: SystemCapability.Web.Webview.Core

Parameters

NameTypeMandatoryDescription
userNamestringYesHTTP authentication user name.
passwordstringYesHTTP authentication password.

Return value

TypeDescription
booleantrue is returned if the authentication is successful; otherwise, false is returned.

isHttpAuthInfoSaved9+

isHttpAuthInfoSaved(): boolean

Sets whether to use the account name and password cached on the server for authentication.

System capability: SystemCapability.Web.Webview.Core

Return value

TypeDescription
booleantrue is returned if the authentication is successful; otherwise, false is returned.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-webview-WebviewController

openharmony 鸿蒙 arkts-apis-webview-t

openharmony 鸿蒙 arkts-apis-webview

openharmony 鸿蒙 capi-arkweb-type-h

openharmony 鸿蒙 arkts-basic-components-web-FullScreenExitHandler

openharmony 鸿蒙 arkts-apis-webview-WebDownloadManager

openharmony 鸿蒙 arkts-basic-components-web-VerifyPinHandler

openharmony 鸿蒙 capi-web-arkweb-webmessage8h

openharmony 鸿蒙 arkts-apis-webview-NativeMediaPlayerHandler

openharmony 鸿蒙 capi-web-arkweb-proxymethodwithresult

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/IBWyXiW0