metatron-app / metatron-discovery

Powerful & Easy way for big data discovery
https://metatron.app
Apache License 2.0
440 stars 110 forks source link

Embed a Dashboard or Chart in another application PROBLEM #3022

Open AlejandroITOP opened 4 years ago

AlejandroITOP commented 4 years ago

Hi i need help, we have a problem embed a Dashboard or Chart in another application.Following the tutorial of this link your (https://metatron.app/2019/05/20/lets-embed-a-dashboard-or-chart-in-another-) application / We have done tests in POSTMAN and everything works but when making the request from PHP this returns us a 403 and CORS.We do not have the CORS configured in our Metatron but it still does not work or using the example that appears in the link mentioned above. photo5814411603477639552 The code we have used is: photo5814411603477639553

I repeat, it works well in POSTMAN but not in our PHP we have extrapolated the code directly from POSTMAN. Thanks for the help

kyungtaak commented 4 years ago

@AlejandroITOP The differences between clients may be due to different header settings. It might be a good idea to compare the RAW headers at the time of the API call.

And can you put the header value like this?

xhr.setREquestHeader("Access-Control-Allow-Origin", "*"); 
kyungtaak commented 4 years ago

@minhyun2 please comment on this thread if you have any other idea.

AlejandroITOP commented 4 years ago

We have tried adding the Allow-Access you mention but the results remain the same. We have reviewed the headers and see nothing anomalous other than that I did not receive the origins.

ufoscw commented 4 years ago

@AlejandroITOP Perhaps the cors configuration for oAuth is missing. We will patch soon.

AlejandroITOP commented 4 years ago

I do not know if it is an error or that we are doing something wrong but when we receive the iframe and embed it in our external app it asks us for a username and password, if we put it it shows us the dashboards but only on the computer that has the session open image image

The previous capture is what it shows in our app

minhyun2 commented 4 years ago

@AlejandroITOP In the attached image, it looks like you're calling the /api/pdi/token URL to get a token. We guided you to call the /oauth/token URL. Please confirm.

AlejandroITOP commented 4 years ago

Sorry, I forgot that this call is a proper endpoint that makes the API call to /oauth/token. My code is: image The API call you commented on "/api/pdi/token" is to receive the token from my endpoint which in turn calls the "/oauth/token" to receive that token. The problem is that if I am not logged in on the page it shows us the Metatron login page and until we log in it does not show the graphics.

AlejandroITOP commented 4 years ago

No idea what the solution might be?

AlejandroITOP commented 4 years ago

We still need help with the issue mentioned in the previous posts, we have the same problem that requires authentication even if we send the token and it returns the dashboard instead of the graph

AlejandroITOP commented 4 years ago

??

minhyun2 commented 4 years ago

Sorry I'm too late. Perhaps we need to add Cors Filter. We will patch soon.