WCF / ASMX :: Writing A MembershipProvider That Authenticates Using A Provider?

Jul 6, 2010

I've been wondering how i go about writing a MembershipProvider that authenticates using a WCF Provider. At the moment i have a wcf service that will authenticate a username and password.

I can write my own Membership provider that will authenticate using WCF calls, thats no problem. What i want is to have the WCF as the actually provider.

Meaning in the web.config file i just put the WCF service as the MembershipProvider. Or is this not possible or not the way this is to be done.

View 1 Replies


Similar Messages:

Security :: Built-in Membership Framework And Has Implemented Own Provider By Creating A Class That Inherits From MembershipProvider?

Jan 23, 2011

used the built-in Membership framework and has implemented his own provider by creating a class that inherits from MembershipProvider (found in System.Web.Security). I actually went ahead and created a custom provider which inherits from MembershipProvider. The problem is that there are several methods I do not really need. Also, the schema is totally different. Plus, most methods return a MembershipUser which means my User class has to inherit from it as well. So really, what benefits does the MembershipProvider and the whole Membership framework add to my system? Do these benefits justify the fact that I won't be using most of the methods on the class?

View 7 Replies

WCF / ASMX :: Writing A .NET REST Wrapper?

Oct 5, 2010

I am a REST web service newbie, does visual studio, .NET, or some other nifty microsoft tool provide any easy way to auto generate classes to consume a REST web service? With REST services is there even a service definition like there is with SOAP (WSDL) beyond the printed documentation? There is a new service that I'd like to consume but they only wrote wrappers for PHP, Pearl, Ruby, and Java and have more or less said you are on your own with .NET. I could write it myself but I'd like to cut corners and save time wherever possible.

View 1 Replies

WCF / ASMX :: Writing A Dataset Recordset To A Stream To Pass To Client?

Mar 3, 2011

I have run into the issue on DataSet.WriteXml method. Apparently, if any row in a column in the DataSet has a null value, the entire column/rows will not write out in the xml file using the method DataSet.WriteXml. So, as terrible as that bug is, I need to send the data another way. Does anyone have any thoughts?

View 4 Replies

WCF / ASMX :: Enum Mapper - C# 3.5 / Easiest Way To Achieve Mapping Without Writing Tedious Switch Statements?

May 25, 2010

We are developing SOA based application using .NET 3.5 and WCF & WPF.

One common issue we are facing is mapping between WCF enum and WPF enums. We had to do mapping between WCF enums to WPF enums. Following is sample code

Switch(WCFServiceObject.Status)
{
Case WCFServiceStatus.Married[code]....

You can see that we have to do mapping WPF and WCF enums. Is there any easiest way to achieve this mapping without writing tedious switch statements? One way of doing this is using Dictionary, but apart from this, is there any good way? We have lots of enums for which have to do mappings.

View 1 Replies

MVC :: ASP.NET Routing The Redirect Url After A User Authenticates?

Apr 11, 2010

I thought I was getting the hang for asp.routing until I ran into this situation. I'm trying to use a data api that requires me to utilize OAuth. Well the redirect url after a user authenticates is:

/MyPage?token=thetoken

Does anyone know how to intercept that request and turn that url into a route that looks like this:

routes.Add("MyRoute",
new
Route("MyPage/{token}",
new
[code]...

View 2 Replies

Security :: JavaScript/AJAX Popup After Specific User Authenticates?

Jan 20, 2010

I have the following scenario and I'm not sure how to implement/tackle it.

I have a login control and roles for different users. When a user logs in I need to display a javascript alert only if the user fullfill special criteria (so not for everyone).

I have tapped into the x_Authenticate and x_LoggedIn events.

In x_Authenticate I do the MembershipProvider verification that the user exists as well as some custom verification. At this point I know that the user has successfully logged in and I can verify if they match the popup criteria.

In x_LoggedIn depending on the user type I redirect to different pages.

Ideally the x_Authenticate event would be the best place to show the popup, however the page isn't rendered then. Instead right after x_Authenticate the x_LoggedIn method gets executed and redirects to the needed page.

View 3 Replies

WCF / ASMX :: Writing A Web Service To Call The Proxy Server From The IIS Web Server In Vb.net?

Feb 6, 2011

How to write a webservice to call the proxy server through IIS webserver?

View 2 Replies

.NET Forms Authentication Authenticates In Localhost Server, But Not On The Web Server?

Sep 12, 2010

I've been implementing the Forms Authentication in ASP.NET with C# (v3.5).I created a simple login form, when the users' email & passwords are stored in my SQL db.When I login in my localhost, everything works just fine, but when I published the project and uploaded it on to my production web server, things got a little bit wierd for me.The ttpContentxt.Current.User.Identity.IsAuthenticated variable return false, even if the login was successfull (and again, in localhost everything works fine).

View 2 Replies

VS 2008 Implement Custom Role Provider And Membership Provider

Sep 27, 2010

I have watched the how to video on Creating a Custom Membership provider. So far it works great. My login control interacts well with it etc. Now i've created a Custom Role Provider. I've created a class that inherits the RoleProvider base class and i've added code to each Sub. My question is, what is the best way to implement the role provider, considering I get the Roles etc from the database?

View 11 Replies

Security :: Forms Authentication With AD Membership Provider And SQL Role Provider?

Jul 27, 2010

I am trying to build an application that

1. user can login by their AD account and password.

2. AD account can be assigned to different group.

I know there is a training video - [URL] to teach how to use the tool to provision the membership schema to SQL server for Forms authentication. but how can I use AD authentication with this?

View 1 Replies

Security :: Get User Info With Custom Provider - Use Provider With Profilecommon?

Apr 16, 2010

I try to get the user profile settings with this code. But all items in it are empty, in the database they are not empty. So there is going something wrong. First of oll how can i add a provider to the ProfileCommon ? Maybe i'm there then... the usrInfo is filled well...

MembershipUser usrInfo = Membership.Providers["MyMembershipProvider"].GetUser(UserName,false);
ProfileCommon prf = (ProfileCommon)Profile.GetProfile(UserName);
LitNaam.Text = prf.Voorletters.ToString() + " " + prf.Achternaam.ToString();

View 2 Replies

Security :: Implement custom Role Provider And Membership Provider?

Dec 1, 2010

i have implemented custom role provider and membership provider .

login page : SignIn.aspx

on successful login it redirects to (index-Homepage.aspx)

now PROBLEM is when it successfully logged in ,and redirects to 'index-Homepage.aspx' it gives Anornymoustemplate ..while its verifying the role correctly in index-Homepage.aspx.cs

View 1 Replies

Security :: Difference Between Role Provider And Membership Provider?

Dec 1, 2010

1 - whats the difference between Role Provider and Membership provider ??

2- If we implement Custom Role Provider or Custom Membership provider then what does this means ? and which Provider do we use when we apply custom role provider or custom membership provider

View 4 Replies

Security :: Big Extension Of Membership Provider - Should Use A New Custom Provider

Mar 27, 2010

i'm building an application and i need to manage roles, users and more things so i tought to use the membership provider but i have some questions about it: can i full extend it and can i override the functions to use a database table to store infos about config or i need to build my own provider?

View 4 Replies

Net SQL Membership Provider Custom Provider Property

Dec 16, 2010

<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
<properties>
<add name="FirstName"/>
<add name="LastName"/>
</properties>
</profile>

I have the code snippet above in my webconfig file. I am attempting to set the FirstName property in codebehind on a register.aspx page. Like this:

Profile.FirstName = ((TextBox)RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("FirstName")).Text;

VS says Profile is in System.Web.Profile Namespace. I then use it like this "System.Web.Profile.FirstName", but says first name does not exist in System.Web.Profile.FirstName namespace.

How do I set the property and later retrieve it?

View 3 Replies

C# - Trying To Unit Test The MembershipProvider?

Nov 21, 2010

I'm trying to unit test the MembershipProvider, however I cant figure out how or whether there is any need for unit testing of it...

My business layer:

public interface IAccountService
{
MembershipCreateStatus CreateUser(string userName, string password, string email);
}
public class AccountService : IAccountService
{
private readonly MembershipProvider provider;
public AccountService() : this(null) { }
public AccountService(MembershipProvider providera)
{
this.provider = providera ?? Membership.Provider;
}
public MembershipCreateStatus CreateUser(string userName, string password, string email)
{
if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", userName);
if (String.IsNullOrEmpty(password)) throw new ArgumentException("Value cannot be null or empty.", password);
if (String.IsNullOrEmpty(email)) throw new ArgumentException("Value cannot be null or empty.", email);
MembershipCreateStatus status;
provider.CreateUser(userName, password, email, null, null, true, null, out status);
return status;
}
}

The only examples I've found so far requires a "MockMembershipProvider" with a local database setup... seems quite odd to me.

View 1 Replies

Custom MembershipProvider With Web Interface And DAL?

Jan 7, 2010

I'm working on an ASP.NET solution with 2 projects. One is the web interface and the other contains my business logic. I'm using LINQ to SQL for my data access in the second project.

Apart of my database, I have a table called Users which holds user information.

I've started to implement a MembershipProvider. I notice that MembershipUser is coupled with MembershipProvider. What is the most correct way of getting my BLL/DAL to talk about Users?
Should I minimally implement MembershipUser and whenever a user calls a method, it will call for eg. GetUserInfo() in my BLL/DAL, to get complete information about the user?

Or should I make the MembershipUser class methods call my custom "Users" class methods (like a wrapper) in the BLL/DAL (this custom users class is not related to linq)?

Or can I somehow extend the Linq to sql class "CFUsers" to extend MembershipUser.

View 1 Replies

Can Configure The ResetPassword In C# MembershipProvider

Apr 2, 2010

I have an C# asp.net app using the default Sql MembershipProvider. My web.config has a few settings that control how I'm using this Provider:

enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresUniqueEmail="true"
passwordFormat="Hashed"
minRequiredPasswordLength="5"

The problem I'm running into is that when people reset their passwords, it seems the ResetPassword() method returns a password that is longer than I want and has characters that can be confusing (l,1,i,I,0,O). Furthermore, I'm sending my users an email with a plain-text message and an HTML message (I'm using MailMessage with AlternateViews). If the password has unsafe HTML characters in it, when the email clients render the HTML text the password might be different (e.g. the %, &, and < aren't exactly HTML safe).

I've looked over the "add" element that belongs in the web.config, but I don't see any extra configuration properties to only include certain characters in the ResetPassword() method and to limit the password length.

Can I configure the ResetPassword() method to limit the password length and limit the character set it is choosing from?

Right now I have a workaround: I call ResetPassword() to make sure the supplied answer is correct, and then I use a RandomPassword generator I downloaded off the internet to generate a password that I like (without ambiguous characters, HTML safe, and only 8 characters long) and then I call ChangePassword() to change the user's password after I've already reset it.

View 3 Replies

Php - MembershipProvider.GetPassword Algorithm?

Dec 1, 2010

We are converting an ASP site (using DotNetNuke) to a new PHP site. The only thing we have right now is a full export of the existing database. One of the tables is called "aspnet_Membership" and contains the following fields:

Password (looks like base64)
PasswordFormat (always value 2)
PasswordSalt (looks like base64)
PasswordQuestion (always empty)
PasswordAnswer (always empty)

We would like to decode these passwords and hash them to fit our own framework. From what I understand from the .NET documentation these kind of passwords can be decrypted. Is there an algorithm available that can do this or is it more complicated than that? Will it be possible if we create an ASP script on the current server?

View 2 Replies

MVC :: Get Reference To Current MembershipProvider?

Aug 5, 2010

Within a controller action, how do I get a reference to the current MembershipProvider? That would be the one specified in web.config as the default provider. I newed up an AccountMembershipService object, but it does not expose the _provider within it.I am not entirely clear on what I want. I want to create a site user in code and then store the UserId as a foreign key in the vendor master of my application. To do that I am thinking I can add a method to my custom membership provider that creates a user and returns the ID of that new user. What I need is be able to get a reference to the custom membership provider in the controller action method.

View 1 Replies

Security :: Get The ConnectionStringName Of MembershipProvider?

Nov 12, 2010

i have a class library for membership provider and inherits from System.Web.Security.sqlMembershipProvider

i just want to change somthing in it this class library will work in difrent web form application

i need to get the connectionStringName in web.config where the membership set to work with it.

how can i get the connectionStringName?

View 3 Replies

C# - Password Validator For MembershipProvider?

Nov 23, 2010

I would like to validate a password field for creating / updating users in asp.net (.net 3.5). The password will be used for a MembershipProvider.What is the best way to implement this so that the validation will use the configuration settings of the membership provider? Of course I can just write the code, but this seems like something so fundamental that there must be a drop-in way to do it.[edit] clarified that this is a password field for new users or for changing passwords, so ValidateUser doesn't help.

View 3 Replies

How To Change An Email In The Db User The MembershipProvider

Oct 14, 2010

I need to give a user the ability to change the email of any other user listed in the aspnetdb. I can easily change their password, but I can't get the email to change. I thought that usr.email = [URL] would work, but it doesn't. It doesn't error, but it also doesn't change anything.

This is the basic code:

Dim usr As MembershipUser = Membership.GetUser(userName)
usr.Email = txtEmail.Text

View 1 Replies

C# - Implement Custom MembershipUser And MembershipProvider

Apr 4, 2011

I try to implement a Custom MembershipPriver with a Custom MemberShipUser in my own database (with a specifics Users Table Model) : This is ly diffent files:

iTwitterMembershipProvider.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Collections.Specialized;
using iTwitter.Models;
public class iTwitterMembershipProvider : MembershipProvider
{
public override string ApplicationName
{
get { return _ApplicationName; }
set { _ApplicationName = value; }
}
public override bool ChangePassword(string username, string oldPassword, string newPassword)
{
throw new NotImplementedException();
}
public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
return false;
}
public override iTwitterMembershipUser CreateUser(string login,
string password,
string email,
string tokenKey,
string tokenSecret,
string twitterUserId,
object providerUserKey,
out MembershipCreateStatus status)
{
ValidatePasswordEventArgs args = new ValidatePasswordEventArgs(login,
password,
true);

[Code.....]

View 2 Replies







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