Use Custom SqlMembershipProvider To Store Users (and Roles) In Cache?

Feb 15, 2011

I'm developing a "small" warehouse-management WebApplication for few users(5-10 parralel) but with a complex authorization system(checking if pages,menus,TabPanels, UserControls and even single controls are visible or enabled) and permanent and frequent access. Because i've only limited experiences with the ASP.Net MembershipProvider, i'm unsure what's the best approach for following goal:

I want to hold all users, roles and frequently used masterdata in the Cache(in a Dataset). Hence every readonly access should be faster and causes less traffic than always using the database. On updates,deletes and inserts i would update the cached dataset and also the database.

Can i use or extend the SqlMembershipProvider to achieve this goal and if possible how?

View 1 Replies


ADVERTISEMENT

Administer Website (create New Users, Assign Users To Roles) From A Windows App?

Feb 9, 2010

I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an encrypted password format), and a SqlRoleProvider. I need to know if it's possible to administer the users (create new users, assign them to roles, etc.) from a windows application - the powers that be don't want any administrative functionality in the web app itself.Here is the membership provider definition from web.config:

<membership defaultProvider="MyProvider">
<providers>
<add name="MyProvider"

[code].....

View 3 Replies

Make A DetailsView Where Only Users With Specific Roles See Some Fields As Editable?

Dec 16, 2011

For example lets say I want only admins to be able to see and edit CustomerID in details view, moderators can see this value but it is not editable, and regular users cannot even see it.

View 2 Replies

ASP.NET MVC Custom User Roles / Profiles

Jan 15, 2010

I am creating a website using asp.net mvc model. When you create an mvc application asp.net automatically creates roles/profiles for user and admins (as far as i know) and corresponding tables in sql server database.I a need a new profile/role names "sponsor" that has all the benefits of users/admins (like authorization etc).

View 1 Replies

Winforms - Use Custom Roles For User Access?

Sep 2, 2009

I have a winforms (VB 2008) based app that I'm developing and I want to use custom roles for user access.Application Layout:I have a Main form that opens a login form when certain actions occur.The Login form intern uses an authentication class that I've created, to authenticate users and set access rights.On my Applications settings page, I have Authentication Mode set to Application-defined because I cannot use Windows Authentication in the environment where this will be deployed.

The application uses a MS SQL 2005 db and the 3 tables I'm using in the authentication process are the User_Account , User_Roles and User_Access tables. The combination of an account in the User_Account and the roles within the User_Roles table are the bases for the User_Access table. Using the User_Access table is how I assign access to the various functions within the application

Authentication Method:To authenticate a user, I'm using the "My.User.CurrentPrincipal" (Code below) method. The My.User object works great and allows the use of "My.User.Name" property throughout the app when referring to the currently authenticated user.

Access Method:In order to set the current users access levels I'm using a function within my Authentication class and passing in My.User.Name as a variable. The function uses a Dataset Table Adaptor and a Select Case statement inside a For loop to assign all the access levels for the user (Function code below).

My Problem:This method of assigning access rights to a user does work but it's not persistent throughout the application as the My.User object is.I would like to find a way to create custom roles through the My.User object using its .IsInRole property. I would like to have these roles dynamically created using my User_Roles table.This would allow the custom roles to be used throughout my application using the My.User.IsInRole ("MyRole")syntax ...similar to how I'm currently able to use My.User.Name.Unfortunately the only roles I can currently validate against are the built in Windows
type accounts (Adminisrator ...ect.).

'User Authentication example:
If Authenticate.CheckPassword(tbxUserName.Text, strPassword) Then
My.User.CurrentPrincipal = New GenericPrincipal(New GenericIdentity(tbxUserName.Text), Nothing)[code].....

View 1 Replies

Implement Custom User-roles In Windows Application

Apr 21, 2010

I am looking for ways to implement custom user-roles in windows application with vb.net. I got a database table called Roles with Administrator and User entries. User cannot see some of the form data. In ASP.NET MVC we can do like.

[Authorize(Roles = "Administrator")]
public function GetAccount() as Array

End Function

View 1 Replies

How To Store And Query An SQL View In Cache

Feb 23, 2012

I am trying to store an SQL View in cache, though I keep getting errors no matter what I try...

When I run the code below, it errors on the take command.

Unable to cast object of type '<TakeIterator>d__3a`1[View_UserSearch]' to type 'System.Linq.IOrderedEnumerable`1[View_UserSearch]'.

Here is the code:

[Code]...

View 1 Replies

Custom Single-Instance Application - Read-only Cache

Mar 14, 2011

I'm trying to build a single-instance application, but not in the traditional sence. Instead of a simple silent prevention of launching a second application, I want it to send a message to said application so it launches a second mainform in my original process.

(I want some read-only cache (language, style,...) shared, and a few sources like local settings shared, but other then that all resources reside in the mainforms and act as seperate applications.)

(I'm not looking for specific code, more for hints/tips and/or general directions, more specificaly on what parameters do you check process equality, and what method do you use to pass the message? Windows Messages? Sockets? ...)

View 11 Replies

Asp.net - Store OpenID Users Into DB Like Stackoverflow Does

Dec 19, 2011

I have made a login system using OpenID using the following code:

[Code]...

It takes the user to Google for authentication. I only want to store the user information like email, full name and sex in my DB. I have written the following code to retrive email from Google but nothing is returned:

[Code]...

View 1 Replies

DB/Reporting :: SqlMembershipProvider In Windowsforms?

Jul 28, 2008

i just recently completed a simple windows project with security authentication that used SqlMembershipProvider and SqlRolesProvider. btw, the application connects to the db via Sql Server authentication. that means all user uses the same connectionstring to access the db.are there loop holes? is these style the least desirable? is these "hackable"?how would this type of implementation would fare compared to windows-based authentication, passport authentication, or a webapp that used same approach above?

View 3 Replies

Cached For Exp Use Cache.insert To Cache Each Property ?

Jul 11, 2009

I have the following code in my config.vb file in app folder and almost all of my pages use this code for permormance issues i need to have it cached for exp use cache.insert to cache each property How should i use caching?

BR>Public Class Config

Private _physicalPath As String

Public Property physicalPath() As String

[CODE]..........................

View 3 Replies

Database - Where To Store Users' Information(personal Details - Username And Password) In Vb

Feb 16, 2011

I'm a newbie in visual basic. I'm doing a login system. I'm done with the GUI. but for the programming part, I want to know where to store new user's information along with the username and password. I've done research. seems like it has something to do with database. p/s: I'm looking for high security in storing data to prevent hacking.

View 1 Replies

Best Way To Store Custom Collection

Mar 29, 2011

I built a custom class and collection for the class for an app that I'm creating. What would be the best way for me to store it so that it will be available on the next startup of the app? It's a pretty simple class with a few strings, etc.

View 12 Replies

Using Custom File To Store

Mar 29, 2012

I made a custom file extension (.varia) and made the value notepad ++. Then I went into notepad++ and added it. Next I saved it as test.varia. But now I don't know how to make the program read it and store text inside of it.[code]

View 6 Replies

Give Users The Option Of Choosing A Custom Color For Text?

Jun 22, 2010

I have made my program but I want to give users the option of choosing a custom color for text. I have an inputbox that works and then converts it to Color.whatever. But seeing as the user types in what they want and it is not done by the program itself it can throw exceptions.

Dim directresponse As String
Dim actualcolor As String
Dim isgood As Boolean

[code]....

That is my Sub, it will make Color.(userinput) but I need to check if Color.(userinput) is actually a color that VB.NET can understand and add set.

I have tried "System.Drawing.Color" I get told it is a type and cannot be used in this context.use System.ComponentModel.TypeDescriptor to convert it to a color and check if it is real and then set it.

View 1 Replies

Use A Custom Collection Derived From CollectionBase To Store Our Business Objects

Feb 26, 2009

We use a custom collection derived from CollectionBase to store our Business objects

[Code]...

View 3 Replies

Create A Custom ListViewItem Class To Store Additional Hidden Info?

Apr 29, 2011

I want to store additional information about a listview item using a custom class, but I can't seem to get it to work.I'm currently using this code to accomplish something similar using a listbox item.I just want to do the same thing with a listview.

Public Class myListboxItem
Public id As String
Public rootFolder As String[code]....

I forgot to add "Inherits ListViewItem" to my class.I'll update the code listed here to serve as an example for others.

View 1 Replies

InputBox Function - Program - Allow User To Input 5 Payrolls For Store 1, Store 2, And Store 3

Mar 22, 2012

I am coding a program that will allow the user to input 5 payrolls for Store 1, Store 2, and Store 3. The total of the 5 payrolls are then added together and shown in the respective Store's labels. A total label is also there to add up all the totals into one number. The numbers in the label must be in currency form. My problem is the numbers don't add correctly when I hit calculate. The first two numbers add together, but then after that the number just seems to subtract a random amount.

So far I have this --

Public Class Form1

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

[CODE[...

View 14 Replies

Using Roles In MVC 3 App

Nov 4, 2011

I have an issue to do with roles in mvc 3 vb.net app..Say I have Admin, Developer, PowerAdmin roles.. if I want to restrict view options based on roles I have been using a if statement in the view to hide the link all together such as:[code]I am also decorating controller actions with authorize in places. The Problem is this say I have several actions that should only be available to say a user who is in all three roles or even 2 of the roles in any combination.. Would I simply nest the if statements in the view to hide those view items? What about controller functions.. Is it possible to decorate controller functions with something like [code]and then have that function only accessible by someone with both roles????

View 2 Replies

(SQL) List User Roles Via SMO

Jun 21, 2010

Is there a method for checking which roles a user has in SQL using SMO? I can add a role via: user.AddToRole("Administrators") But cannot see an obvious method to progmatically list them.

View 2 Replies

Change Database Roles In SQL Through VB

Apr 23, 2010

I fiqured out how to create a new user in vb for SQL, but when I try to access the database, I get a select error. I went into SQLMSO and changed the membership role to db_datareader and db_datawriter and ran my form again and I was allowed to delete and add records. Is there a way with the below to add a user and let them add and delete records.

[Code]...

View 1 Replies

Roles Only Returning 1 Role

Jun 16, 2010

I am having a problem with my roles Identification. I am try to read all the roles for a given user. No matter what I try only the first role, only 1 role for the user is being returned. My code is as follows.

[Code]...

View 3 Replies

VS 2008 Database Search - Using SQLClient That Loops Though All Users In A Users Table

Dec 29, 2010

I've got a code using SQLClient that loops though all users in a Users table inside each loop i want to preform another search in the UserOrders table, thus doing a count of all orders.

I get this error

HTML

There is already an open DataReader associated with this Command which must be closed first.

Here is my code

vb.net UserLists.Items.Clear()
Dim connection As New SqlClient.SqlConnection(My.Settings.ConnectString)
Dim command As New SqlClient.SqlCommand("SELECT * FROM Users ORDER BY PersonName",

[CODE]...

View 3 Replies

.net Desktop App : Log Users Application's Usage By Users After Remote Deployment?

Apr 3, 2012

1.I�d like to publish a free vb.net desktop application for the users to download and use meanwhile I�d like to collect usage information ex: user ip address, user�s registration information, used features, time spent� if the user allows the report to be sent back.

2.Also , in order for the user to be able to use the application, he�ll have to register it then, everytime, before the application loads, it gets verified online that it was registered, maybe validate the registration information or a valid user name and password, no critical personal information. The target of this step is for the application to be used exclusively by the registered user and maybe on his computer only.

View 2 Replies

Vb.net Desktop App : Log Users Application's Usage By Users After Remote Deployment

Apr 4, 2012

1. I�d like to publish a free vb.net desktop application for the users to download and use meanwhile I�d like to collect usage information ex: user ip address, user�s registration information, used features, time spent� if the user allows the report to be sent back. 2. Also , in order for the user to be able to use the application, he�ll have to register it then, everytime, before the application loads, it gets verified online that it was registered, maybe validate the registration information or a valid user name and password, no critical personal information. The target of this step is for the application to be used exclusively by the registered user and maybe on his computer only. Any alternative way to achive the target is just fine.

View 1 Replies

Asp.net - Setting Up Different Roles Depending On Url In Web.config?

Jan 17, 2012

<authentication mode="Windows"/>
<authorization>
<allow users="USERS"/>

[code]....

Is there a way to write an if statement in here to detect what url I am on so I can allow a certain role for that certain URL.

Example code in my head of what I kind of want to see:

If (UCase(Url) = UCase("URL")) Then
<allow roles="ROLES"/>
ElseIF(UCase(Url) = UCase("URL")) Then

[code]....

Is this even allowed in the web.config? I have 3 websites. One for Dev, UAT and PROD. Now for each sites I have different user groups for each set up. I just want to find a way that I can just find what URL i'm at and point it at the certain user group. I'm guessing I have to make a web.config for each because you can't do conditional statements but I'm just making sure. If I have to make a web.config for each how can I go about setting that up?

View 3 Replies

How To Show Roles Based Menu

Dec 9, 2009

How to show menu according to their roles in vb.net2.0

View 8 Replies

Vb.net - Membership Roles.GetUsersInRole Not Working For Me

May 13, 2010

[code]...


The code above throws a "Specified method is not supported." exception on the first line.
Any one knows what am doing wrong here?

View 2 Replies

Get Path Of 'All Users' Desktop And 'All Users' Start Menu

Jun 10, 2008

I cannot figure out how to get this call to work.I have searched EVERYWHERE.MSDN is no help at all and the only thing I can find is this vb6 code that doesn't work in .net.I tried to convert it over but I've had no luck.Specifically I'm trying to get the path of the "All Users" Desktop and the "All Users" Start Menu.It would rock if anyone could help me out with this one.

View 5 Replies

Add User To Roles During CreateUserWizard.CreatedUser Step?

Jan 22, 2011

How to add user to roles during CreateUserWizard.CreatedUser?What's wrong in this code:

Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As EventArgs) Handles CreateUserWizard1.CreatedUser
Dim username As TextBox =

[code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved