0% found this document useful (0 votes)
144 views2 pages

Msa Callback

This document defines a JavaScript function that parses parameters from a URL hash fragment, extracts error information if present, constructs a JSON error message object, and posts it to the parent window or opener using postMessage. The function parses the hash fragment, checks for common OAuth error parameters, and builds a JSON object with the error details to send back to Skype.com.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views2 pages

Msa Callback

This document defines a JavaScript function that parses parameters from a URL hash fragment, extracts error information if present, constructs a JSON error message object, and posts it to the parent window or opener using postMessage. The function parses the hash fragment, checks for common OAuth error parameters, and builds a JSON object with the error details to send back to Skype.com.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>Skype</title>

<script type="text/javascript">
var message = "";

[Link] = (function () {
"use strict";

return {
hashParams: {},

parseHashParams: function (windowObj) {


var hash,
hashPairs,
hashPair,
delimiterIndex,
key,
value,
ind;

windowObj = windowObj ? windowObj : window;


hash = [Link]("#", "");
[Link] = {};
hashPairs = [Link]("&");
for (ind in hashPairs) {
hashPair = hashPairs[ind];
delimiterIndex = [Link]("=");
if (delimiterIndex >= 0) {
key = decodeURIComponent([Link](0,
delimiterIndex)).toLowerCase();
value =
decodeURIComponent([Link](delimiterIndex + 1));
[Link][key] = value;
}
}
},
getHashParam: function (key) {
return [Link][[Link]()];
}
};
})();

(function () {
var target = "[Link]
messageObject = {"error":"invalid_grant","error_description":"User
is not authenticated at MSA"};

[Link]();
var error = [Link]("error");
var errorDescription =
[Link]("error_description");

if (!!error && [Link]) {


[Link] = error;
messageObject.error_description = errorDescription;
}

var message = [Link](messageObject);

if (!![Link]) { // Send postMessage


from a Popup and close window
[Link](message, target);
[Link]();
} else if (!![Link]) { // Send postMessage
from an Iframe
[Link](message, target);
}
}());
</script>
</head>
<body>
</body>
</html>

You might also like