Last active
September 25, 2015 16:57
-
-
Save dlrust/954102 to your computer and use it in GitHub Desktop.
idkit example for federatedidentity.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>IDKIT javascript example</title> | |
</head> | |
<body> | |
<div id="idkit-root"></div> | |
<script src="https://www.federatedidentity.com/static/js/idkit.js"></script> | |
<script> | |
IDKIT.init({appId: '721113'}); | |
IDKIT.getLoginStatus(function(response) { | |
if(response.session) { | |
alert(response.session.username + ' is logged in'); | |
} | |
else if(response.error) { | |
alert(response.error); | |
} | |
else { | |
alert('user not logged in'); | |
} | |
}) | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>IDKIT login example</title> | |
</head> | |
<body> | |
<div id="idkit-root"></div> | |
<script src="https://www.federatedidentity.com/static/js/idkit.js"></script> | |
<script> | |
IDKIT.init({appId: '721113'}); | |
IDKIT.loginWithToken('721113.93f6d8c833072f12a775708d62c28412.1304930402'); | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>IDKIT login example</title> | |
</head> | |
<body> | |
<div id="idkit-root"></div> | |
<script src="https://www.federatedidentity.com/static/js/idkit.js"></script> | |
<script> | |
IDKIT.init({appId: '721113'}); | |
IDKIT.logout(function() { | |
// Do something after the logout (i.e. redirect the user) | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment