Using DotNetOpenAuth.AspNet how to check, on post back, if the response is from a provider
===

I'm having a play around with the Microsoft extensions to DotNetOpenAuth which provide some handy presets for well known providers. My problem is that there seems to be no way, on post back, to tell if the response is coming from the page or an openid provider.

The usual way is to create an instance of `OpenIdRelyingParty` and check the response to see if it is null or not. The `VerifyAuthentication` method of a client (see code below) does this and throws an invalid operation exception if it is null. Therefore, I can either manually check `OpenIdRelyingParty.GetResponse` myself, which seems wasteful, or try/catch the exception, which seems wrong.

Is there another way? Should I be checking the HttpContext.Current.Response?

   
    // Start the request. GoogleOpenIdClient automatically adds a FetchRequest with
    // email, firstName etc.
    protected void loginButton_Click(object sender, EventArgs e)
    {
        var google = new DotNetOpenAuth.AspNet.Clients.GoogleOpenIdClient();
        google.RequestAuthentication(null, HttpContext.Current.Request.Url);
    }

    protected void Page_Load(object sender, EventArgs e)
    {

        var google = new DotNetOpenAuth.AspNet.Clients.GoogleOpenIdClient();
        DotNetOpenAuth.AspNet.AuthenticationResult res;
          
        try
        {
            res = google.VerifyAuthentication(null);
        }
        catch (System.InvalidOperationException ex)
        {
            // Do what you'd do with a regular postback
            return;
        }

        if (res.IsSuccessful)
            {
                var data = res.ExtraData;
                var email = data.FirstOrDefault(item => item.Key == "email");
                ...
            else
            {
                // Authentication failed
                this.loginCanceledLabel.Visible = true;
                return;
            }
    }