After hub receives subscription requests and to verify the request the hub sends an HTTP GET request to the subscriber's callback URL as given in the subscription request. This request has following parameters:
"hub.challenge"
"hub.mode"
"hub.topic"
"hub.lease_seconds"
"hub.verify_token"
The subscriber MUST confirm that the hub.topic and hub.verify_token correspond to a pending subscription or unsubscription that it wishes to carry out. If so, the subscriber MUST respond with an HTTP success (2xx) code with a response body equal to the hub.challenge parameter. If the subscriber does not agree with the action, the subscriber MUST respond with a 404 "Not Found" response.
Sample code on how to process hub subscription verification requests on subscriber's callback URL:
protected void Page_Load(object sender, EventArgs e)
{
string HUBChallenge = Request.QueryString["hub.challenge"];
string HUBMode = Request.QueryString["hub.mode"];
string HUBFeedURL = Request.QueryString["hub.topic"];
string HUBLease_Seconds = Request.QueryString["hub.lease_seconds"];
string HUBVerify_Token = Request.QueryString["hub.verify_token"];
if (Subscription_Verified(HUBMode, HUBFeedURL, HUBVerify_Token))
{
Response.Write(HUBChallenge);
}
else
{
Response.StatusCode = 404;
Response.StatusDescription = "Not found";
}
}
private Boolean Subscription_Verified(string Mode, string FeedURL, string Token){
//Verify the subscription request here
Boolean check = true;
return check;
}