Skip to content

Instantly share code, notes, and snippets.

@ryanvalentin
Last active December 16, 2015 09:59
Show Gist options
  • Save ryanvalentin/5416819 to your computer and use it in GitHub Desktop.
Save ryanvalentin/5416819 to your computer and use it in GitHub Desktop.
Example usage of the Disqus SSO example class
/*
In your code-behind file, create a new instance of the DisqusSSO class, set the API key and call the generate method. NOTE: The method is overloaded and will optionally accept an avatar URL and/or a profile URL.
Depends on SSO class payload generator found here: https://github.com/disqus/DISQUS-API-Recipes/blob/master/cs/sso/DisqusSSO.cs
*/
public string Payload { get; private set; }
public void GetSSOPayload(bool authenticated)
{
if (authenticated == true)
{
DisqusSSO sso = new DisqusSSO();
sso.DisqusApiSecret = "DISQUS_SECRET_KEY";
Payload = sso.GetDisqusPayload("uniqueId_123456789", "Charlie Chaplin", "charlie.chaplin@example.com");
}
else
{
Payload = sso.LogoutUser();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment