0

Within WebView, I need to send authorization header token along with iframe src like this:

<WebView
    source={{
      html: '<iframe src="www.myserver.com/verifytoken.php"></iframe>',
      headers: authHeader,
    }}
/>

Please give me a clue how to achieve this?

Thank you.

webmastx
  • 653
  • 7
  • 27

1 Answers1

0

Try:

class TestCase extends Component {

    render() {
        return(
            <WebView
                source={{
                    uri: xyz,
                    headers: { Authorization: abc }
                }}
            />
        )
    }
}

More available here: https://github.com/react-native-webview/react-native-webview/issues/18#issuecomment-534968842

And you can add header in iframe, reference: https://stackoverflow.com/a/13432834/10305444

Maifee Ul Asad
  • 2,815
  • 3
  • 25
  • 65