Problem reading encrypted credentials from registry

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default RE: Problem reading encrypted credentials from registry

    The user that you are running ASP.NET as (ASPNET, or some customer user) will need to have access to the registry to read it.
    David Coe, MCP Guest

  2. Similar Questions and Discussions

    1. Credentials problem
      Hello, I have written an asp.net application which collects some messages from Exchange Server 2003 in a public folder, using WebDav protocol. ...
    2. reading client's registry
      Is there a way to read the client's registry through asp.net? Specifically, I want to be able to determine if a certain version of Office is...
    3. Reading Registry value...
      Hi, I am trying to read a value from a registry key using RegRead method but it does not seem to work. Here's the code that I am using: Dim...
    4. reading the registry
      Is there any way to read a registry key (on a PC) using lingo?
    5. Reinstaled, Lost profiles, encrypted files left encrypted
      Bob; Are you sure it is not an Ownership issue: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q308421& If the files are encrypted. If...
  3. #2

    Default RE: Problem reading encrypted credentials from registry

    ----- David Coe, MCP wrote: ----

    The user that you are running ASP.NET as (ASPNET, or some customer user) will need to have access to the registry to read it
    ---------------------
    I am running IIS 6 and Server 2003 so I set the "NETWORK SERVICES" account to have read access (I also tried full access). I checked the processes and ASPNET was not running but I tried ASPNET as well (with both read and full access) and the same error. I also tried to give permissions to all of the users of the running processes and still had the same error. I tried anonomous as well and still the same error

    Below is the system.web section of my web.config file. If I comment out the identity section it works correctly. When it is not commented out the error message also points directly to the line that begins the identity section so that seems to be the problem

    Do I need to set permissions in some place other than the registry? What else do you suggest

    Thanks, Matthe

    <system.web><compilation defaultLanguage="vb" debug="true" /><customErrors mode="RemoteOnly" /><authentication mode="Windows" /><identity impersonate="true
    userName="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET_SETREG,userName
    password="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET_SETREG,password" /><authorization><allow users="*" /><!-- Allow all users --></authorization><trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="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 requestEncoding="utf-8" responseEncoding="utf-8" /
    </system.web>
    Matthew Guest

  4. #3

    Default Re: Problem reading encrypted credentials from registry

    Hi,

    I'm getting the same error. I have it working fine on a Windows 2000
    server, but I get the same error Matthew does when I do the same thing on
    Windows 2003.

    Adam


    "Matthew" <mhiklem(at)mimh(dot)edu> wrote in message
    news:94ABDB4E-24FD-40A9-A904-DB98963EF0D5@microsoft.com...
    > ----- David Coe, MCP wrote: -----
    >
    > The user that you are running ASP.NET as (ASPNET, or some customer
    user) will need to have access to the registry to read it.
    > ----------------------
    > I am running IIS 6 and Server 2003 so I set the "NETWORK SERVICES" account
    to have read access (I also tried full access). I checked the processes and
    ASPNET was not running but I tried ASPNET as well (with both read and full
    access) and the same error. I also tried to give permissions to all of the
    users of the running processes and still had the same error. I tried
    anonomous as well and still the same error.
    >
    > Below is the system.web section of my web.config file. If I comment out
    the identity section it works correctly. When it is not commented out the
    error message also points directly to the line that begins the identity
    section so that seems to be the problem.
    >
    > Do I need to set permissions in some place other than the registry? What
    else do you suggest?
    >
    > Thanks, Matthew
    >
    > <system.web><compilation defaultLanguage="vb" debug="true" /><customErrors
    mode="RemoteOnly" /><authentication mode="Windows" /><identity
    impersonate="true"
    >
    userName="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET
    _SETREG,userName"
    >
    password="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET
    _SETREG,password" /><authorization><allow users="*" /><!-- Allow all
    users --></authorization><trace enabled="false" requestLimit="10"
    pageOutput="false" traceMode="SortByTime" localOnly="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 requestEncoding="utf-8" responseEncoding="utf-8" /
    > </system.web>

    Microsoft Newsgroups Guest

  5. #4

    Default Re: Problem reading encrypted credentials from registry

    Oops -- meant to say that I have it running fine on Windows XP, but not
    Windows 2003.


    "Matthew" <mhiklem(at)mimh(dot)edu> wrote in message
    news:94ABDB4E-24FD-40A9-A904-DB98963EF0D5@microsoft.com...
    > ----- David Coe, MCP wrote: -----
    >
    > The user that you are running ASP.NET as (ASPNET, or some customer
    user) will need to have access to the registry to read it.
    > ----------------------
    > I am running IIS 6 and Server 2003 so I set the "NETWORK SERVICES" account
    to have read access (I also tried full access). I checked the processes and
    ASPNET was not running but I tried ASPNET as well (with both read and full
    access) and the same error. I also tried to give permissions to all of the
    users of the running processes and still had the same error. I tried
    anonomous as well and still the same error.
    >
    > Below is the system.web section of my web.config file. If I comment out
    the identity section it works correctly. When it is not commented out the
    error message also points directly to the line that begins the identity
    section so that seems to be the problem.
    >
    > Do I need to set permissions in some place other than the registry? What
    else do you suggest?
    >
    > Thanks, Matthew
    >
    > <system.web><compilation defaultLanguage="vb" debug="true" /><customErrors
    mode="RemoteOnly" /><authentication mode="Windows" /><identity
    impersonate="true"
    >
    userName="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET
    _SETREG,userName"
    >
    password="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET
    _SETREG,password" /><authorization><allow users="*" /><!-- Allow all
    users --></authorization><trace enabled="false" requestLimit="10"
    pageOutput="false" traceMode="SortByTime" localOnly="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 requestEncoding="utf-8" responseEncoding="utf-8" /
    > </system.web>

    Microsoft Newsgroups Guest

  6. #5

    Default Re: Problem reading encrypted credentials from registry

    Okay -- I figured out my problem. I needed to set permissions for the local
    NETWORK SERVICE account.
    When selecting users to add permissions for, click the Advanced button, then
    the Locations button. Select the local server name at the top and click OK.
    Click the Find Now button and select the NETWORK SERVICE account. This is
    the account that needs permissions on the reg key you created.

    Good luck!


    "Microsoft Newsgroups" <afroio@cmins.com> wrote in message
    news:ukpz8DYTEHA.1232@TK2MSFTNGP09.phx.gbl...
    > Oops -- meant to say that I have it running fine on Windows XP, but not
    > Windows 2003.
    >
    >
    > "Matthew" <mhiklem(at)mimh(dot)edu> wrote in message
    > news:94ABDB4E-24FD-40A9-A904-DB98963EF0D5@microsoft.com...
    > > ----- David Coe, MCP wrote: -----
    > >
    > > The user that you are running ASP.NET as (ASPNET, or some customer
    > user) will need to have access to the registry to read it.
    > > ----------------------
    > > I am running IIS 6 and Server 2003 so I set the "NETWORK SERVICES"
    account
    > to have read access (I also tried full access). I checked the processes
    and
    > ASPNET was not running but I tried ASPNET as well (with both read and full
    > access) and the same error. I also tried to give permissions to all of the
    > users of the running processes and still had the same error. I tried
    > anonomous as well and still the same error.
    > >
    > > Below is the system.web section of my web.config file. If I comment out
    > the identity section it works correctly. When it is not commented out the
    > error message also points directly to the line that begins the identity
    > section so that seems to be the problem.
    > >
    > > Do I need to set permissions in some place other than the registry? What
    > else do you suggest?
    > >
    > > Thanks, Matthew
    > >
    > > <system.web><compilation defaultLanguage="vb" debug="true"
    /><customErrors
    > mode="RemoteOnly" /><authentication mode="Windows" /><identity
    > impersonate="true"
    > >
    >
    userName="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET
    > _SETREG,userName"
    > >
    >
    password="registry:HKEY_LOCAL_MACHINE\SOFTWARE\MY_ SECURE_APP\Identity\ASPNET
    > _SETREG,password" /><authorization><allow users="*" /><!-- Allow all
    > users --></authorization><trace enabled="false" requestLimit="10"
    > pageOutput="false" traceMode="SortByTime" localOnly="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 requestEncoding="utf-8" responseEncoding="utf-8" /
    > > </system.web>
    >
    >

    Microsoft Newsgroups Guest

  7. #6

    Default RE: Problem reading encrypted credentials from registry



    "David Coe, MCP" wrote:
    > The user that you are running ASP.NET as (ASPNET, or some customer user) will need to have access to the registry to read it.
    I tried a number of times to set permissions for the Network service account. but it failed to access it each time. Finally, after a 3 week vacation I tried again and was successful. I think my problem was that I set the permissions to high on the registry tree. Setting them on the lowest branch lead to success.

    I did run into another problem with the password. I could read it from the registry but it could not create a valid user token from it. This even though when I used the same password as a simple string it would create the user. After some experimentation I discovered that the percent character "%" which I had included in the password was causing the problem. Changing that to another character alowed the password to be read correctly. I am not sure where the "%" was causing the problem (encryption, storage, retrieval, decryption) but changing it took care of my problems.

    Thanks for the assistance.

    Matthew
    Matthew Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139