Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <script type="text/javascript">
- var baseUrl = 'https://org.okta.com';
- var requestPath = '/oauth2/v1/revoke';
- var xhr = new XMLHttpRequest();
- if ("withCredentials" in xhr) {
- xhr.onerror = function() {
- alert('Invalid URL or Cross-Origin Request Blocked. You must explicitly add this site (' + window.location.origin + ') to the list of allowed websites in the administrator UI');
- }
- xhr.onload = function() {
- alert(this.responseText);
- };
- xhr.open('POST', baseUrl + requestPath, true);
- xhr.setRequestHeader("Accept", "application/json");
- xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- xhr.withCredentials = true;
- xhr.send("client_id=CLIENT_ID_HERE&token_type_hint=access_token&token=ACCESS_TOKEN_HERE");
- } else {
- alert("CORS is not supported for this browser!")
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement