Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title></title>
- <script type="text/javascript" src="https://env-92950.trial.cloud.microstrategy.com/MicroStrategyLibrary/javascript/embeddinglib.js"></script>
- <script type="text/javascript">
- var postData = {};
- postData.username = "yogi";
- postData.password = "weblogic";
- postData.loginMode = 1;
- </script>
- </head>
- <body onload="load()">
- <div id="mydossier" height="100%" width="100%"></div>
- <script type="text/javascript">
- var myDossier;
- /* Minimal information necessary to authenticate with Guest(Anonymous) authentication */
- var postData = {
- loginMode: 1
- }
- function getXHRRequestPromise(url, body, method, contentType, desiredHeader) {
- return new Promise(function(resolve, reject) {
- var xhr = new XMLHttpRequest();
- xhr.open(method, url);
- xhr.setRequestHeader('Content-Type', 'application/json');
- xhr.setRequestHeader("Accept", "application/json");
- xhr.send(JSON.stringify(body));
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 2) {
- resolve(xhr.getResponseHeader(desiredHeader));
- } else {
- reject({
- status: this.status,
- statusText: xhr.statusText
- });
- }
- };
- });
- };
- function load() {
- var container = document.getElementById("mydossier"),
- url = "https://env-92950.trial.cloud.microstrategy.com/MicroStrategyLibrary/app/19E3120C11E847D125D60080EFF5FD36/FCD0BEC011E8B5FE1F7C0080EFB57F21";
- microstrategy.dossier.create({
- url: url,
- enableCustomAuthentication: true,
- enableResponsive: true,
- customAuthenticationType: microstrategy.dossier.CustomAuthenticationType.AUTH_TOKEN,
- placeholder: container,
- getLoginToken: function() {
- return getXHRRequestPromise('https://env-92950.trial.cloud.microstrategy.com/MicroStrategyLibrary/api/auth/login', postData, 'POST','application/json', 'x-mstr-authToken').then(function(authToken){
- return authToken;
- });
- },
- })
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement