[Mono-osx] How to logon to Win or Mac using credentials through code?

Tomasz Muszyński thom at union.waw.pl
Thu Jan 22 11:14:37 EST 2009


d_v pisze:
> I should be more specific, besides I have not heard any ideas yet :)
>
> When I say "logon" I really mean that I am trying to copy a file over the
> network and I would like to supply the username and password and (domain). 
> At this point I don't even know if a Mac requires a domain name...
>
> If you can point me in the right direction I would be grateful. even a
> link/bone :)
>
>
> d_v wrote:
>   
>> Does anyone have a good way to logon to Windows and a Mac using
>> credentials through code?
>>
>> I am using the Impersonator code and am now trying to get it to run on Mac
>> 2.2_5 (latest build).
>>
>> The error I recieved was:
>>     
... windows code here cutted...

The code You attached authenticates user on a specific Windows Share 
using Win32 API, so it's worth nothing here :)

What You want to do? Access SMB Shares? If so, how you want to do that.
Did You try just to use URL paths, eg: smb://user:pass@address/share? (I 
didn't try, because now I'm on Windows machine).

Try to look there: 
http://developer.apple.com/documentation/Networking/Conceptual/CFNetwork/CFNetwork.pdf
Maybe You will find something. Ask on Apple Dev Forums, as this is Mac 
OS X releated problem instead of Mono.

Otherwise, you will have to call "mount" command manually to mount SMB 
shares.

If You want JUST to authenticate, you will have to use Kerberos or LDAP 
(proper frameworks are available).

Regards,
Tomasz Muszyński




More information about the Mono-osx mailing list