EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Username over network share?

Posted: 11/03/2010 14:35:53
by Shawn Jetton (Basic support level)
Joined: 11/03/2010
Posts: 7

Can I get the username from the user accessing a file via a drive being shared over the network?

I have my cbfs running on system_1 with the ability to mount the drive. On system_2 I mount my cbfs from system_1 as my H drive. When I access a file on system_2 I need to check the user of system_2 against access rights held in a database.
Posted: 11/03/2010 14:55:44
by Eugene Mayevski (Team)

Did you use GetOriginatorToken function in CBFS? Try obtaining the token and then extract any information you can reach via this token. Here's a forum topic about GetOriginatorToken.

Sincerely yours
Eugene Mayevski
Posted: 11/03/2010 15:16:53
by Shawn Jetton (Basic support level)
Joined: 11/03/2010
Posts: 7

I tried
IntPtr securityToken = mCbFs.GetOriginatorToken();
WindowsIdentity identity = new WindowsIdentity(securityToken);

But identity.name only returned me the user name of the user logged into the server at the time.

system_1 logged in with user_a
system_2 logged in with user_b

system_1 is running my cbfs application
system_2 has mapped the cbfs drive as H. When openning a file on system_2 I get user_a from identity.name.

I need the username of the person logged into system_2 since they are the one accessing the file.
Posted: 11/03/2010 15:24:11
by Shawn Jetton (Basic support level)
Joined: 11/03/2010
Posts: 7

Nevermind I started appending a log file and I can confirm I am getting the correct user info.. Thank you.



Topic viewed 1292 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!