Skip to content

Instantly share code, notes, and snippets.

View richardprice's full-sized avatar

Richard Price richardprice

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SimpleAuthNancyExample.Models
{
public class IndexViewModel
{
public string ErrorMessage { get; set; }
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SimpleAuthNinjectExampleNancy</title>
</head>
<body>
<h2>Index</h2>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Nancy;
namespace SimpleAuthNancyExample.Modules
{
public class HomeModule : NancyModule
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Autofac;
using Autofac.Integration.Mvc;
@model SimpleAuthAutofacExample.Models.AuthenticateCallbackViewModel
<h1>AuthenticateCallback</h1>
@if (Model.Exception != null)
{
<h2>Error Information</h2>
<p>>Message: @Model.Exception.Message<br />
</p>
<p>StackTrace: @Model.Exception.StackTrace</p>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SimpleAuthAutofacExample.Models
{
public class IndexViewModel
{
public string ErrorMessage { get; set; }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SimpleAuthentication.Core;
namespace SimpleAuthAutofacExample.Models
{
public class AuthenticateCallbackViewModel
{
@using SimpleAuthentication.Mvc
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>Welcome to SimpleAuthAutofacExample</p>
<br /><br />
<a href="@Url.RedirectToProvider("facebook")">Login to Facebook</a>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SimpleAuthAutofacExample.Models;
using SimpleAuthentication.Mvc;
namespace SimpleAuthAutofacExample
{
kernel.Bind<SimpleAuthentication.Mvc.IAuthenticationCallbackProvider>()
.To<SimpleAuthNinjectExample.SimpleAuthenticationCallbackHandler>();