.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Pass ASP.NET membership identity object across domain?

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I am trying to figure a way to SSO with ASP.NET membership and role model.

I can implement custom membership provider which consume web services hosting on a server.

With encryption of data. No problem.

But my question is, If I sign on a website with my provider, got my identity object on that application,

could I pass it to another website on another domain which use the same provider and by doing so, do not need to login again?

If this is possible, I am going to implement this solution. Please tell me what's your take on this.

View Complete Post

More Related Resource Links

Create COM object from ProgID in a separate domain

Hi, How should I create COM object from ProgID in a separate app. domain? After I created corresponding Type object by means of Type.GetTypeFromProgID, I cannot use neither Activator.CreateInstance nor <MySeparateAppDomain>.CreateInstance because both require assembly name as one of the arguments... but as I said before I have no RCW assembly - just a ProgID. Those Activator.CreateInstance overloads which have argument of AppDomain type do not accept argument of Type type, only argument "assembly name" (of String type). And neither of <MySeparateAppDomain>.CreateInstance overloads accept argument of Type type (all require assembly name and type name). Any ideas?!

How to pass values using http header to another domain?

Hi,There are two applications "Sender", "Receiver"."Receiver" is a asp.net page, running in a server"Sender" is not an asp.net page and running in some other server."Sender" is passing a string (eg. userName) through http header."Receiver" is reading the string from http header as follows        Request.Header["userName"].How to pass values through http header? Can I have some samples?Thanks,Ashokan

How to Pass a Grid an EF Object and have it edit/update etc. without postbacks until save?

Hey all.Here's what I'm trying to do:I want to pull an EF object, or create a new one. Pass it to javascript (jquery or some such) and then have the grid bind on the client side and do everything client side from that point forward. (edits, validation etc.) Once complete, I want jquery to push back via a pagemethod or web service or whatever, the updated EF object so that i can persist it.Reason?I need a highly scalable architecture that handles not storing objects in the session or posting to a database when they haven't been saved to a user. I know I can do this with Silverlight, however given MS's less than convincing comments about Silverlight's future vs HTML 5, I'm strongly leaning towards asp.net or mvc.net if I can come up with a way to use jquery (or even a 3rd party control that does this!) to handle all of the data editing, updating etc. for a master/child display (i.e. Invoice) without the server having to store it and without having to use the viewstate.Ideas?In my mind this would be the holly grail. Render the page, push the data to the controls, have the controls do their thing until save without ever doing server processing, and then on save, push back the object and allow the server to persist it (and probably do server validation before presisting it just in case). By doing this you could make superscalable apps that

Membership web part 'Object Expected' error

I have placed a Membership Web Part on my 'My Site'/'My Content' page and everything was working just fine until the number of memberships supassed the total number that the control is set to display. When this happened, a link appeared at the bottom of the web part with the following wording 'Show 8 additional memberships'. When I click on this link I receive an 'Object Expected' javescript error. When I look at the code that is generated on the page the <a></a> tag for this link appears as follows ... <a class="ms-vb" id="1SPS_MEMMICSRCHRES_Link" href="javascript:ShowHidePrivacyRow('SPS_MEMMICSRCHRES','1', '1SPS_MEMMICSRCHRES_Link', 'Hide 8 additional memberships', 'Show 8 additional memberships');"> When I do a search for the ShowHidePrivacyRow() function it does not appear on the page and I can not seem to find it in any of the SharePoint out of the box .js files either. Could this be the cause of the 'Object Expected' error? If so, how do I solve this and why is an out of the box web part causing javascript errors. This is something I would expect from a product that is still in Beta, not a production release.

Aggregate Object Pass as a hidden value

How to use Html.Hidden for aggregate object?For Example, I have Model1 which aggregates Model2. Model:class Model1{.. public Model2 model2;..} class Model2{ public int id; public int name; .... //there are many fields//  } View:ViewPage is tied with Model1.ViewPage<Model1> I can pass Model2 values by specifiying its fields like<%= Html.HiddenFor(x => x.model2.id) %><%= Html.HiddenFor(x => x.model2.name) %> What I want is to pass Model2 as hidden value without specifying its each field. Any idea how to correct line below<%= Html.HiddenFor(x => x.model2) %>//I'm getting null value for model2 Thanks  

how to pass membership userID to db table


 i'm using asp.net membership for logins/registeration. i have a bookings table with few fields, lets say first_name, last_name, product_name and userID.

when the user submits 'buy' i want to get the userID from the membership user tablem that way i know whose made the booking. i'll have these two tables (bookings & user tables) linked

but how do i get userID from the user table to pass to bookings table? i checked the membership class and it gives options like

-Membership.GetUser(), Membership.GetUserNameByEmail(), Membership.GetAllUsers() etc

nothing for getting user id. user id is stored like this: c1c91682-449f-45dd-b20e-3dac5315bba4

some suggestions how to do this, plz?




MVC3 + How to pass JSON Object as dictionorary object


In MVC3 Beta version i have action result same like

public ActionResult Save(Dictionary<string, string> dicObject)


I want to pass JSON Object in POST Method from javascript and need to get as dictionoray object


How can i do this? can you write example if possible?


Its urgent, please hep me




User.Identity.Name returns app pool user instead of domain user


2 server web farm windows 2008 r2 nlb.  In IIS I enable windows authentication all other authentication is disabled.


code behind

       protected void Page_Load(object sender, EventArgs e)
            if (!Page.IsPostBack)
                Response.Write("Auth user: " + Request.ServerVariables["Auth_User"]);
                Response.Write("Logon user: " + Request.ServerVariables["LOGON_USER"]);


        <authentication mode="Windows" />        
            <deny users="?" />            

        <compilation debug="true" targetFramework="4.0" />

The code returns the application pool custom account e.g. DOMAIN\WebApp_user.  What I want is the logged in user's username.  How do I get this? 

Operation is not valid due to the current state of the object - while using membership class in shar


My Code for creating an FBA user programatically -




                SPSite osite = SPContext.Current.Site;
                MembershipCreateStatus createStatus;
                MembershipUser Muser=Membership.CreateUser("test", "pass@word1", "test@test.com", "FbaPasswordQuestion", "FbaPasswordAnswer", true, out createStatus);

                SPWeb oweb = osite.OpenWeb();
                oweb.AllowUnsafeUpdates = true;
                if (createStatus == MembershipCreateStatus.Success)

Pass object to web service


I'd like to pass an object (Digital Persona featureset) to a web service.  Can't seem to find a good way to serialize it.

Any suggestions?


Operation is not valid due to the current state of the object at Membership.CreateUser (FBA) in Shar


I have a SharePoint 2010 Web App configured with Claims Based Authentication (FBA). Whenever my code encounters Membership.CreateUser or any Membership class methods, it gives me the "Operation is not valid due to the current state of the object"  error.

The same Membership Provider code is working fine in a standalone ASP.Net application.


Using IPC only channel getting Unable to cast object of type 'System.Runtime.Remoting.Identity' to


I have a remoting application that is using delegates to preform callbacks between processes. I found that if I don't use a TCP channel at all and only initialize an IPC channel that the callback delegates start throwing the following error after about a minute has passed.

From what little I could find on Google it seems to be a Lifetime Service management issue but all the classes that the delegates belong to return null from InitializeLifetimeService which should give the object an infinite lifetime.

With the TCP channel initialized the issue doesn't happen, but I would like it to use the IPC channel if all of the processes are on the local box.


Type:        System.InvalidCastException
Message:    Unable to cast object of type 'System.Runtime.Remoting.Identity' to type 'System.Runtime.Remoting.ServerIdentity'.
Stack Trace:   
Server stack trace:
   at System.Runtime.Remoting.RemotingServices.GetServerTypeForUri(String URI)
   at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)


SQL Server Domain membership remove/add


OS = Windows 2008 R2 64 bit

SQL Server 2008 R2 64 bit

SQL server is installed with added feature of Reporting and Analysis services. The Services are running under a domain account.

We need to remove and re-add the server from the domain due to it continually failing authentication.

Are there any problems or known issues in doing this? Will SQL services still function OK?



how to pass a user defined object as an argument to a web server?


I have the following scenario:

1. my web server is in c#, and my web server client is in Java

2. on the java side, I have a user defined object,  (it is implemented as a java bean) and i would like to pass this object, as an argument to one of the web server methods.

3. the problem however is, that on the C# side, i get a compilation error, saying that the type or namespace could not be found.

I read some forum threads saying that it should be serialised, but i have no idea of what to do, to be quite honest. Could someone please help by either explanation or a helpful link with an example?

Many thanks,


Can I pass a SqlParameterCollection object into a SQL Command

I currently have a connection class that handles all of my database connectivity. What I am trying to do is build a SqlParameterCollection object on one page, then pass that object to my connection class. Is it possible to do this? I am not getting any compilation errors, but I can not get the parameters to be recognized. Here is what I am trying to do: Page 1: string sql = null; conn.strConn = connectionstring; sql = "sqlstring"; SqlParameterCollection newcollect = null; newcollect.Add("@Switch",1); conn.OpenReader(sql, newcollect); while (conn.DR.Read()) { read data onto page here... } conn.CloseReader(); Page 2 (connection class) : public void OpenReader(string sql, SqlParameterCollection collect) { Conn = new SqlConnection(strConn); Conn.Open(); Command = new SqlCommand(sql,Conn); Command.Parameters.Add(collect); <------This is the root of my question Command.CommandTimeout = 300; // executes sql and fills data reader with data DR = Command.ExecuteReader(); } Can you do this??? And if so, can anyone tell me why the statement will not return any data? The procedure works perfectly, and will work if I use the standard way of passing the parameters to the command statement.

Take image or Binary object From SQL and Pass into an XML Document


I have a SQL Table which holds document data in the form of type image (or possibly binary but as far as I can see image is more reliable).

I have a websewrvice which needs to pull the documents from the database, pass the details into an XML file which is retrieved by the application calling the webservice, and then the document files written out at the other end.

My question is what is the best way to go about this?

I believe (but possibly I am wrong) that I need to convert the image data to base64 first.  I know there is the sql command select X from A FOR XML AUTO, BINARY BASE64 which does the conversion but I am not sure how to then write this into an XML document.

Any assistance any one can offer is greatly appreciated as I have not had any experience with working with binary or image, and only very very basic knowledge of XML

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend