Home > Uncategorized > Assigning a new user to Visitor group using FBA

Assigning a new user to Visitor group using FBA

Assuming that you have already set up the membership provider and configured your SharePoint site to use Forms based authentication, here are the steps to add a user to the data store (via membership) and associating it to the Visitors group. You can extend this code to support other group associations such as owners, contributor or even your own custom groups.


 


1) After you add a new user to the data source using the membership provider, examine the returned status parameter and act accordingly as shown below. You can find the complete code here  as a web part.



 


2) Install the web part  included in this post (you need to add the class to a solution ,compile it and deploy it yourself:))


3) Now, log in to the site using a user name and password which has appropriate access to the membership provider.


4) Add a new user  (e.g. username : chado , password:pass@word1)


5)New user(chado) should have been added to the visitor group which also means that new user has been successfully added to the data source.


6)Sign in as a different user


7) Since you are using forms authentication, you will be redirected to the login.aspx page. Enter the right credentials (chado,pass@word1) and hit “Sign In” button.


8) Now, you are logged in under the new user’s security context. This user is a visitor to this site.


 



Categories: Uncategorized Tags:
  1. No comments yet.
You must be logged in to post a comment.