0
votes

I have a website using firebase auth.

I develop native mobile app (android, iOS or Unity) also using firebase auth sdk.

After user get authenticated on Mobile app, I'll open a webview so users can use my website. How can I get user logged in to webview using credential they provided in mobile app?

1

1 Answers

0
votes

If you want to send the authorization token with every webview request, you should override onReceivedHttpAuthRequest method in WebViewClient like so.

webView.webViewClient = object : WebViewClient() {

    override fun onReceivedHttpAuthRequest(view: WebView?, handler: HttpAuthHandler?, host: String?, realm: String?) {
        handler?.proceed("token_auth", "authtoken_here")
    }

}