Created
August 23, 2013 16:53
-
-
Save richardprice/6321527 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 SimpleAuthAutofacExample.Models; | |
using SimpleAuthentication.Mvc; | |
namespace SimpleAuthAutofacExample | |
{ | |
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