Created
September 17, 2013 16:44
-
-
Save richardprice/6597027 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 Nancy; | |
using Nancy.SimpleAuthentication; | |
using SimpleAuthNancyExample.Models; | |
namespace SimpleAuthNancyExample.Helpers | |
{ | |
public class SampleAuthenticationCallbackHandler : IAuthenticationCallbackProvider | |
{ | |
public dynamic Process(NancyModule nancyModule, AuthenticateCallbackData model) | |
{ | |
return nancyModule.Negotiate.WithView("AuthenticateCallback").WithModel(model); | |
} | |
public dynamic OnRedirectToAuthenticationProviderError(NancyModule nancyModule, string errorMessage) | |
{ | |
var model = new IndexViewModel | |
{ | |
ErrorMessage = errorMessage | |
}; | |
return nancyModule.View["index", model]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment