Created
August 23, 2013 15:12
-
-
Save richardprice/6320448 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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