Skip to content

Instantly share code, notes, and snippets.

@richardprice
Created September 17, 2013 16:44
Show Gist options
  • Save richardprice/6597027 to your computer and use it in GitHub Desktop.
Save richardprice/6597027 to your computer and use it in GitHub Desktop.
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