7 Replies - 1070 Views - Last Post: 08 May 2013 - 09:19 PM Rate Topic: -----

#1 RandomlyKnighted  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,365
  • Joined: 14-January 10

Forms Authentication?

Posted 08 May 2013 - 06:02 PM

I've got a ASP.NET MVC4 application and I created it using the Internet Application template. So thanks to the template it auto-generated all the code for the Forms Authentication. I know it uses a SQL Server database to handle the user accounts. However, I've begun creating my own database for my web application and it will show certain features only if you have been given access to those features. Would it be better to use the built-in database that the template created and adapt it work wit my application or just create my own user table in my database and use that in the account creation/login?

What are the pros and cons over one of the other such as modularity, security, etc?

Is This A Good Question/Topic? 0
  • +

Replies To: Forms Authentication?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9201
  • View blog
  • Posts: 34,575
  • Joined: 12-June 08

Re: Forms Authentication?

Posted 08 May 2013 - 06:16 PM

Eh.. if you bolt in some tables and have the data return back and store the user role in a session variable.. as pages load read the session variable and enable/disable things as they are needed.
Was This Post Helpful? 1
  • +
  • -

#3 RandomlyKnighted  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,365
  • Joined: 14-January 10

Re: Forms Authentication?

Posted 08 May 2013 - 07:20 PM

So since the template already validates the user registration and logging in if I just point it to my database it should take care of the rest right?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9201
  • View blog
  • Posts: 34,575
  • Joined: 12-June 08

Re: Forms Authentication?

Posted 08 May 2013 - 08:18 PM

No... you need to tell it to pull back the right role values..
Was This Post Helpful? 0
  • +
  • -

#5 RandomlyKnighted  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,365
  • Joined: 14-January 10

Re: Forms Authentication?

Posted 08 May 2013 - 08:37 PM

Alright, I guess that means its time to watch the rest of those user validation videos on Pluralsight to find out about the user roles.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9201
  • View blog
  • Posts: 34,575
  • Joined: 12-June 08

Re: Forms Authentication?

Posted 08 May 2013 - 08:40 PM

Eh.. you just make those up as you go. Take one standard sheet of paper and write out, down the side, a list pf various areas that would need to restrict at some level. Across the top throw down your role names for people.

Now in each box put: no access, read, or write for each section by role.

Voila!
Was This Post Helpful? 1
  • +
  • -

#7 RandomlyKnighted  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,365
  • Joined: 14-January 10

Re: Forms Authentication?

Posted 08 May 2013 - 09:15 PM

So pretty much all I'd need to do is have a column in my database be their role and when they log in I load that into a variable for validation and to determine if they have access to the feature?
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9201
  • View blog
  • Posts: 34,575
  • Joined: 12-June 08

Re: Forms Authentication?

Posted 08 May 2013 - 09:19 PM

Yeah.. I would assign numeric roles.. and for the love of Pete always have 0 (or what ever the column default value) be 'no access'... If you want to get fancy you'll need a table to hold the decoding values of sections to rolls to NA, R, W access... or you can hard code it in the forms.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1