Embed grafana graph to react native

2.2k Views Asked by At

I'm trying to embed the graph from grafana to react native app by using the embed code from sharing feature

Example

<iframe src="http://10.199.6.232:9000/dashboard-solo/db/dashboard-22?from=1484025371312&to=1484046971313&panelId=1" width="450" height="200" frameborder="0"></iframe>

I use the src from iframe uri for WebView in react native, but I meet authen issue, because I'm not login on react native app.

<WebView source={{ uri: url, headers: {'Authorization': 'Basic YWRtaW46YWRtaW4='} }} startInLoadingState={true}

        />

How can I embed without request user login? (can I do login in background?)

1

There are 1 best solutions below

0
On

Your WebView will not include the user's Safari/Chrome cookies, thus he will have to log in.

You can run the url through an authenticated proxy of your own if that is possible in your scenario, or just send him to Safari/Chrome.