You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

Durandal.Authentication

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Durandal.Authentication

To get started create a new Web Api project with the authentication set to 'Individual User Accounts' then install this package. This package adds authentication (ASP.NET Identity version 2.0.0) to Durandal 2.0.1 (the Bootstrap 3 starterkit version). The expected version of JQuery is 1.10.2. If you are using another version update the jquery path in App/main.js. If you are using ASP.NET Identity version 1.0.0 please install version 1.7.3 of this package.

2.0.0
Source
nugetNuGet
Version published
Maintainers
1
Created
Source

#Durandal 451

Durandal 2.0.1 running with ASP.NET 4.5.1 using OWIN security to provide:

  • site based and 3rd party user authentication,
  • local SPA authorization and customization based on role membership.

For more information please see the series of blog posts on this project here.

#Getting started

During the database initialization two roles are created:

  • Administrators
  • RegisteredUsers

A user called Administrator is also created with the password 'Administrator451' and added to both roles. Edit IdentityDbInitializer if you need to change this, or add more roles and users.

To configure route based authorization add a property requiredRoles to each route that needs to be checked when setting up the route map.

{ route: 'start', moduleId: 'viewmodels/start', nav: true, requiredRoles: ['RegisteredUsers'] },
{ route: 'siteAdmin', moduleId: 'viewmodels/start', nav: true, requiredRoles: ['Administrators','PowerUsers'] }

To render areas of a view based on the role membership use the ifIsInRole custom KO binding.

<div data-bind="ifIsInRole: 'Admnistrators' ">
    <h2>Admin</h2>
    <p>This is an admin section which will only be visible if the current user is in the 'Admnistrators' role.</p>
</div>

#References

This project is based on the following packages and components:

Keywords

Durandal

FAQs

Package last updated on 18 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts