A program written in untrusted code (e.g., JAVA) is enabled to access a
native operating system resource (e.g., supported in WINDOWS NT) through
a staged login protocol. In operation, a trusted login service listens,
e.g., on a named pipe, for requests for login credentials. In response to
a login request, the trusted login service requests a native operating
system identifier. The native operating system identifier is then sent to
the program. Using this identifier, a credential object is then created
within an authentication framework. The credential object is then used to
login to the native operating system to enable the program to access the
resource. This technique enables a JAVA program to access a WINDOWS NT
operating system resource under the identity of the user running the JAVA
program.