Giter Club home page Giter Club logo

fubumvc.authentication's Introduction

FubuMVC.Authentication

Provides a pluggable authentication infrastructure for your FubuMVC application.

How do I use it?

Step 1. Simply install it via NuGet:

Install-Package FubuMVC.Authentication

Step 2. Implement the services

If you run as-is, the bottle will blow up on you (on purpose) telling you that you're missing two things: 1) IAuthenticationService and 2) IPrincipalBuilder.

You will need to implement and register both of these custom-tailored services.

Step 3. [Optional] Configuration

If you wish to configure how the Bottle is applied, you can do the following:

Import<ApplyAuthentication>(x => {
	// Explictly state which behavior chains to authenticate
	x.Include(chain => ...);
	
	// Explicitly state which behavior chains to exclude from authentication
	x.Exclude(chain => ...);
	
	// By default, you get ~/login and ~/logout (with extensibility points). Use this method to turn them off.
	// If you use the defaults, just create a view that is typed against FubuMVC.Authentication.LoginRequest.
	x.DoNotIncludeEndpoints();
});

fubumvc.authentication's People

Contributors

coreykaylor avatar garylcoxjr avatar jeremydmiller avatar jmarnold avatar mtscout6 avatar robertthegrey avatar stevematney avatar

Watchers

 avatar  avatar  avatar  avatar

fubumvc.authentication's Issues

CookieTicketSource needs to do a full on HtmlDecode

I think the decode I found was HttpContext specific so the code in there is just flat out stupid. We need to do a complete decode before the base64 decryption or it's going to blow up in most situations under SelfHost.

Authentication being forgotten

After logging in, IMembershipRepository is being called as expected, MatchesCredentials is returning true, as soon as you hit a page that requires an authenticated user your redirected back to the login page. The FubuAuthTicket cookie is being created as expected.

Needs to be easier to swap out the MembershipRepository

See this garbage from Portal:

            //TODO: since FubuMVC.Authentication hard codes the membership node to use MembershipRepository
            //there is no way to extend it, had to do it this way instead
            settings.Strategies.AddToEnd(new MembershipNode(typeof(OurMembershipRepository)));
            settings.Strategies.OfType<MembershipNode>()
                    .Where(x => x.MembershipType == typeof(MembershipAuthentication))
                    .ToArray()
                    .Each(x => x.Remove());

Convenience method to opt out of authentication on all routes

For some sites, opting into authentication for every route might not be the most ideal. In order to remove this functionality, you have to configure the bottle in a way that might not be the most intuitive:

Import<ApplyAuthentication>(authentication =>
{
    authentication.Include(chain => false);
    //Configure routes to include authentication
});

It would be nice to have an option to easily opt out of authentication from all routes and then configure the routes that need to be authenticated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.