Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save richardprice/6320448 to your computer and use it in GitHub Desktop.
Save richardprice/6320448 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SimpleAuthentication.Mvc;
using SimpleAuthNinjectExample.Models;
namespace SimpleAuthNinjectExample
{
public class SimpleAuthenticationCallbackHandler : IAuthenticationCallbackProvider
{
public System.Web.Mvc.ActionResult OnRedirectToAuthenticationProviderError(HttpContextBase context, string errorMessage)
{
return new ViewResult
{
ViewName = "AuthenticateCallback",
ViewData = new ViewDataDictionary(new IndexViewModel
{
ErrorMessage = errorMessage
})
};
}
public System.Web.Mvc.ActionResult Process(HttpContextBase context, AuthenticateCallbackData model)
{
return new ViewResult
{
ViewName = "AuthenticateCallback",
ViewData = new ViewDataDictionary(new AuthenticateCallbackViewModel
{
AuthenticatedClient = model.AuthenticatedClient,
Exception = model.Exception,
ReturnUrl = model.ReturnUrl
})
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment