I'm not sure if it's safe to assume that many folks will be integrating this library into MVC projects that contain an AccountsController from the default MVC template, but I noticed that the returnUrl parameter of the ExternalLoginCallback method is null after the redirect. Since the returnUrl parameter is actually inside the state parameter that Google passes back, I had to add the following snippet:
GoogleOAuth2Client.RewriteRequest();
// Pull the returnUrl from the rewritten request,
// since it was originally packed in the state parameter.
var url = Request.QueryString["ReturnUrl"];
if (string.IsNullOrEmpty(returnUrl) && url != null)
{
returnUrl = url;
}
OAuthWebSecurity.VerifyAuthentication(....)
This may be something others find useful and might be helpful to include in the Usage section of the readme.
I'm not sure if it's safe to assume that many folks will be integrating this library into MVC projects that contain an AccountsController from the default MVC template, but I noticed that the returnUrl parameter of the ExternalLoginCallback method is null after the redirect. Since the returnUrl parameter is actually inside the state parameter that Google passes back, I had to add the following snippet:
This may be something others find useful and might be helpful to include in the Usage section of the readme.