This project is read-only.

MVC Security with the MvcMusicStore Chapter 7

Feb 14, 2013 at 12:51 AM
In chapter 7 I believed I followed all the directions
  • Added the Controller, Model, and Views to the project
  • Created an Administrator role through the configuration
  • Created a user and added them the the Administrator role
  • Added the Authorize attribute to the StoreManager class
Now when I browse to /StoreManager I am redirected to a login.aspx page with a Return URl back to StoreManager instead of going through the Account controller, that is what I would expect to happen?

What possibly did I do wrong?
Feb 14, 2013 at 2:06 AM
So I had to add in the webconfig
<authentication mode="Forms">
      <forms loginUrl="~/Account/Logon"  />
Because the default on a 302 error is to go to the login.aspx page

Also I had to change the name spaces on all the Account Views to

@Model MvcMusicStore.Models.<WhateverModel>