Home All Groups Group Topic Archive Search About

IIS authentification with a ASP Application on a SAMBA host

Author
15 Jul 2005 11:33 PM
jtolksdo
Hi,

I'd like to upload files within a asp.NET web-application through
Microsoft IIS 6.0 to a SAMBA network share, which requires an
authentication. The SAMBA Server is not a member of a domain. The
Windows 2003 Server either not. Both are dedicated Server.

The Webser has two NIC. One is connected to the internet
(212.xxx.xxx.xxx) and one is connected to the LAN (10.1.1.1) where te
SAMBA server (10.1.1.2) ist located. I'd like to download and upload
files via a self developed ASP.NET web-frontend over the IIS-Web-Server
to the SAMBA Server. There is no problem to up- and download
everything, when I have my ressource files locally, but I'd like to use
the Samba Server. When I try to access the Samba Server via logged in
Administrator-Account, everything works, because I have set up the
username and password from the Samba-Server in the "Stored user names
and password" option of the Administrator Account in Windows 2003. If I
try to acces the files via pure IIS virtual directory, it works either,
becauce I have set up the "login as .." option to the right username.

My ASP.NET Application has no user context where it runs in.
Does anyone has a clue how to give either the ASP.NET Application
another user context or how to solve my issue in another way?

BTW: It works with Microsoft Cassini Web-Server when I start Casssini
with the Administrator Account. I cannot start WWW-Server with
Administrator Accound. Maybe someone can help to start IIS with another
account ...

thanks in advance
Juergen

Author
16 Jul 2005 12:10 AM
Tiago Halm
Use mirror accounts. Same local usr/pwd on both boxes.
Use <identity impersonate="true|false" userName="username"
password="password"/> inside your web.config or setup an anonymous user
which mirrors the samba server user. The samba user must be ACLed to write
on the Samba server, of course.

Hope it helps

Tiago Halm


<jtolk***@hotmail.com> wrote in message
Show quoteHide quote
news:1121470412.034789.104920@z14g2000cwz.googlegroups.com...
> Hi,
>
> I'd like to upload files within a asp.NET web-application through
> Microsoft IIS 6.0 to a SAMBA network share, which requires an
> authentication. The SAMBA Server is not a member of a domain. The
> Windows 2003 Server either not. Both are dedicated Server.
>
> The Webser has two NIC. One is connected to the internet
> (212.xxx.xxx.xxx) and one is connected to the LAN (10.1.1.1) where te
> SAMBA server (10.1.1.2) ist located. I'd like to download and upload
> files via a self developed ASP.NET web-frontend over the IIS-Web-Server
> to the SAMBA Server. There is no problem to up- and download
> everything, when I have my ressource files locally, but I'd like to use
> the Samba Server. When I try to access the Samba Server via logged in
> Administrator-Account, everything works, because I have set up the
> username and password from the Samba-Server in the "Stored user names
> and password" option of the Administrator Account in Windows 2003. If I
> try to acces the files via pure IIS virtual directory, it works either,
> becauce I have set up the "login as .." option to the right username.
>
> My ASP.NET Application has no user context where it runs in.
> Does anyone has a clue how to give either the ASP.NET Application
> another user context or how to solve my issue in another way?
>
> BTW: It works with Microsoft Cassini Web-Server when I start Casssini
> with the Administrator Account. I cannot start WWW-Server with
> Administrator Accound. Maybe someone can help to start IIS with another
> account ...
>
> thanks in advance
> Juergen
>
Author
16 Jul 2005 2:58 PM
jtolksdo
Thanks. Where do I have to import it?
I get an exception on every line I've tried ..... :-(

Can anyone PLEASE help?

here is my web.config:

-------

<?xml version="1.0" encoding="utf-8" ?>
<identity impersonate="true" userName="user" password="word"/>
<configuration>
    <appSettings>
        <add key="DateTimeFormatSelect" value="{2}-{1}-{0} {3}:{4}:{5}"/>
        <add key="PostgreConnection" value="Server=postgredb; Port=5432; User
Id=user; Password=pass; Database=t_db;"/>
        <add key="ConnectionType" value="3"/>

        <add key="userAudioPath" value=""/>
        <add key="ServerAudioPath" value="\\\\server\\Documents\\" />
        <add key="ServerAudioStream" value="http://localhost/files/" />
        <add key="DbDateTimeFormat" value="{0}-{1}-{2} {3}:{4}:{5}" />
        <add key="DTM_HTTP2SMS_Url"
value="http://messagegate.blah.com/sms.php?"/>
        <add key="DTM_HTTP2SMS_CustomerID" value="10.0345"/>
        <add key="DTM_HTTP2SMS_ProjectID" value="8302"/>
        <add key="DTM_HTTP2SMS_Sender" value="user"/>
        <add key="DTM_HTTP2SMS_Format" value="101"/>
        <add key="DTM_HTTP2SMS_SenderIP" value="10.1.1.10"/>
        <add key="DTM_HTTP2SMS_StatusOk" value="ok"/>
    </appSettings>


  <system.web>
    <!--  DYNAMIC DEBUG COMPILATION
          Set compilation debug="true" to enable ASPX debugging.
Otherwise, setting this value to
          false will improve runtime performance of this application.
          Set compilation debug="true" to insert debugging symbols
(.pdb information)
          into the compiled page. Because this creates a larger file
that executes
          more slowly, you should set this value to true only when
debugging and to
          false at all other times. For more information, refer to the
documentation about
          debugging ASP.NET files.
    -->
    <compilation
         defaultLanguage="c#"
         debug="true"
    />

    <!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom
error messages, "Off" to disable.
          Add <error> tags for each of the errors you want to handle.

          "On" Always display custom (friendly) messages.
          "Off" Always display detailed ASP.NET error information.
          "RemoteOnly" Display custom (friendly) messages only to users
not running
           on the local Web server. This setting is recommended for
security purposes, so
           that you do not display application detail information to
remote clients.
    -->
    <customErrors
    mode="RemoteOnly"
    />

    <!--  AUTHENTICATION
          This section sets the authentication policies of the
application. Possible modes are "Windows",
          "Forms", "Passport" and "None"

          "None" No authentication is performed.
          "Windows" IIS performs authentication (Basic, Digest, or
Integrated Windows) according to
           its settings for the application. Anonymous access must be
disabled in IIS.
          "Forms" You provide a custom form (Web page) for users to
enter their credentials, and then
           you authenticate them in your application. A user credential
token is stored in a cookie.
          "Passport" Authentication is performed via a centralized
authentication service provided
           by Microsoft that offers a single logon and core profile
services for member sites.
    -->
    <authentication mode="Forms">
            <forms name=".DATA" loginUrl="default.aspx" protection="All"
timeout="60" />
    </authentication>

    <!--  AUTHORIZATION
          This section sets the authorization policies of the
application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean
everyone, "?" means anonymous
          (unauthenticated) users.
    -->

    <authorization>
        <allow users="*" /> <!-- Allow all users -->
            <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
    </authorization>

    <!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output for every
page within an application.
          Set trace enabled="true" to enable application trace logging.
If pageOutput="true", the
          trace information will be displayed at the bottom of each
page.  Otherwise, you can view the
          application trace log by browsing the "trace.axd" page from
your web application
          root.
    -->
    <trace
        enabled="false"
        requestLimit="10"
        pageOutput="false"
        traceMode="SortByTime"
        localOnly="true"
    />

    <!--  SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests
belong to a particular session.
          If cookies are not available, a session can be tracked by
adding a session identifier to the URL.
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false"
            timeout="20"
    />

    <!--  GLOBALIZATION
          This section sets the globalization settings of the
application.
    -->
    <globalization
            requestEncoding="utf-8"
            responseEncoding="utf-8"
   />



</system.web>

</configuration>