Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTML
<style>
.gigyaDocButton {
	border: 1px solid #034f7c;
	color:   #ffffff !important;
    padding: 5px 10px;
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#33a7e3", endColorstr="#49b8f2");
    background: linear-gradient(top, #33a7e3, #49b8f2) !important;
    background: -ms-linear-gradient(top left, #33a7e3, #49b8f2) !important;
    background: -webkit-gradient(linear, left top, left bottom, from(#33a7e3), to(#49b8f2)) !important;
    background: -moz-linear-gradient(top, #33a7e3, #49b8f2) !important;
    margin-bottom: 1px;
    margin-top:0px;
    text-decoration: none;
    border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
}
.gigyaDocButton:hover {
	border: 1px solid #149dd6;
    padding: 5px 10px;
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#49b8f2", endColorstr="#33a7e3");
    background: linear-gradient(top, #49b8f2, #33a7e3) !important;
    background: -ms-linear-gradient(top left, #49b8f2, #33a7e3) !important;
    background: -webkit-gradient(linear, left top, left bottom, from(#49b8f2), to(#33a7e3)) !important;
    background: -moz-linear-gradient(top, #49b8f2, #33a7e3) !important;
	color:   #ffffff !important;
    margin-bottom: 0px;
    margin-top: -1px;
    text-decoration: none;
    border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
}
</style>
 
<div class="" id="" style="border: 1px solid skyblue; padding: 15px; width: auto; max-width: 85%; display: block; height: auto;">
<script>
    function loginCallback(response) { // The callback that handles the response object from the IdP
        loginData = response;
        returnedObject = JSON.stringify(loginData,undefined,4);
        document.getElementById('JStext').innerHTML = returnedObject;
        console.log(loginData);
    }
    gigya.socialize.addEventHandlers({  // Support for handling the response in RaaS
       onLogin: loginCallback
   })
    function loginToIdp() {  // Logs into the IdP via the socialize.login method
        var login_params =  ({
           //'provider': 'saml-testShib-gig02', 
			'provider': 'saml-wiki-demoidp.demo.gigya.01',
           'callback': loginCallback
        });
        gigya.socialize.login(login_params);
    }
    function onLogout(response) {  // Handles user logout
        if ( response.errorCode == 0 ) {               
            alert('You are now logged out');
            //window.location = "yourSite/LogoutPage.html";
        }
        else {
            alert('Error :' + response.errorMessage);
        }
    }
    function logMeOut() {  // Logs out the user
        gigya.accounts.logout({callback:onLogout,
				forceProvidersLogout: true});
    }
function showRaasIdp() {  // Implements the IdP within a RaaS Screen-Set
customButtons = [{
	// The custom button object for the IdP within a RaaS Screen-Set
    "type": "saml",
    "providerName": "idp.demo.gigya.01", //"providerName":"testShib-gig02",
    "idpName":"idp.demo.gigya.01",
    "iconURL": "http://developers.gigya.com/download/attachments/15795144/IDP.png",
    "logoURL": "http://developers.gigya.com/download/attachments/14650850/placeholderImage.png",
    "lastLoginIconURL":"http://developers.gigya.com/download/attachments/15795144/Externalidp_LastLogin.png",
    "position":"4"
}];
    
customButton_params =
{
    "customButtons": customButtons,
    "showTermsLink":false, // 'terms' link is hidden
    "screenSet":"NewRaas4nov15-RegistrationLogin"
}
gigya.accounts.showScreenSet(customButton_params);
}
</script>
Click One Of The Buttons Below To Use <strong>Gigya As An SP</strong> with <a href="http://www.testshib.org/" target="_blank">TestShib.org</a> as IdP.<br /><br />
<input type="button" class="gigyaDocButton" value="Test IdP Login" onclick="loginToIdp();" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="gigyaDocButton" value="IdP with RaaS" onclick="showRaasIdp();" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="gigyaDocButton" value="Logout" onclick="logMeOut();" />
<br /><br />Response:
<div class="responseDiv" id="responseDiv">
	<textarea id="JStext" value="" style="background-color: #EFEFEF; width: 80%; max-width: 80%; border: 3px inset grey; min-height: 300px; overflow: auto; border-radius: 7px;"></textarea>
</div>

...