Created
December 14, 2013 20:33
-
-
Save icydee/7964576 to your computer and use it in GitHub Desktop.
RadiusLogin example
This file contains 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
<html> | |
<head> | |
<script src="https://hub.loginradius.com/include/js/LoginRadius.js" ></script> | |
<script src="js/libs/login-radius.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
var options={}; | |
options.login=true; | |
LoginRadius_SocialLogin.util.ready(function () { | |
$ui = LoginRadius_SocialLogin.lr_login_settings; | |
$ui.interfacesize = ""; | |
$ui.apikey = "78855680-671c-4c70-b194-2e392a0a7c81"; | |
$ui.callback=""; | |
$ui.lrinterfacecontainer ="interfacecontainerdiv"; | |
LoginRadius_SocialLogin.init(options); | |
}); | |
LoginRadiusSDK.onlogin = Successfullylogin; | |
function Successfullylogin() { | |
LoginRadiusSDK.getUserprofile(function (data) { | |
//just display to a html element | |
document.getElementById("profile").innerHTML = JSON.stringify(data); | |
}); | |
return false; | |
}; | |
</script> | |
</head> | |
<body> | |
<p>hello world</p> | |
<div id="interfacecontainerdiv" class="interfacecontainerdiv"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running this code, it correctly brings up a login box allowing me to log into the site using Facebook. When authenticated it appears as though the action is this...
The apikey etc. is sent to LoginRadius, but LoginRadius then call a POST to my registered URL, i.e. http://spacebotwar.com/login.html with the value token: xxxxxxx
I don't want a post, I want it to call-back to me with the result.
Having said that, I have just noticed the 'callback' in the above code. Off to experiment...