Added in API level 1

HttpAuthHandler


open class HttpAuthHandler : Handler
kotlin.Any
   ↳ android.os.Handler
   ↳ android.webkit.HttpAuthHandler

Represents a request for HTTP authentication. Instances of this class are created by the WebView and passed to WebViewClient.onReceivedHttpAuthRequest. The host application must call either proceed or cancel to set the WebView's response to the request.

Summary

Public methods
open Unit

Instructs the WebView to cancel the authentication request.

open Unit
proceed(username: String!, password: String!)

Instructs the WebView to proceed with the authentication with the given credentials.

open Boolean

Gets whether the credentials stored for the current host (i.e. the host for which

Inherited functions

Public methods

cancel

Added in API level 1
open fun cancel(): Unit

Instructs the WebView to cancel the authentication request.

Note: The host application must call this method on the host application's UI Thread.

proceed

Added in API level 1
open fun proceed(
    username: String!,
    password: String!
): Unit

Instructs the WebView to proceed with the authentication with the given credentials. Credentials for use with this method can be retrieved from the WebView's store using WebView.getHttpAuthUsernamePassword.

Note: The host application must call this method on the host application's UI Thread.

useHttpAuthUsernamePassword

Added in API level 1
open fun useHttpAuthUsernamePassword(): Boolean

Gets whether the credentials stored for the current host (i.e. the host for which WebViewClient.onReceivedHttpAuthRequest was called) are suitable for use. Credentials are not suitable if they have previously been rejected by the server for the current request.

Note: The host application must call this method on the host application's UI Thread.

Return
Boolean whether the credentials are suitable for use