7 Replies Latest reply on Mar 2, 2012 5:36 PM by 906552

    OracleMembershipProvider Form Authentication

      I created asp.net (VS2005 and NET2.0) application which access Oracle database. Following the Oracle Database 2 Day + .NET Developer’s Guide 11g I enabled my Web site for Authentication:
      1. Created web user for application using Oracle Providers for ASP.NET to start the application with login page and allow user to access application if credentials are correct. Users are created with Web Site Administration Tool of VS2005 after I set to use Oracle ASP.NET providers.
      Running application from Designer worked great, login, authentication..

      We set web site with virtual directory on IIS6 of Server 2003 and we could not login. Each user login attempt failed with "Your login attempt was not successful. Please try again" message, similar as user did not have correct credentials.

      Searching online about similar problem I found an article which describes requirement to have "applicationName" property. In this article (Always set the "applicationName" property when configuring ASP.NET2.0 Membership and other Providers) is noted that a membership is usually added in web.config without an “applicationName” attribute and this behavior does not let you login on remote server without error, just with message noted above.
      Explanation is that asp.net without applicationName attribute calculates applicationName using vroot path of the web-server. The article says that you can see in aspnet_application table (I guess that table ora_aspnet_applications in OracleMembershipProvider coresponds to AspNetSqlProvider aspnet_application) that stores a unique applicationID for each applicationName and column applicationName (aspnet_application) is filled by as the calculated name of test machine that was used at the time.
      I checked table that are part of OracleMembershipProvider and I found ApplicationID has value but applicationName was empty even if I created custom OracleProvided with applicationName set for my application in web config and created users using this provider.

      As I still have the same problem to login from web site (IIS and Server2003) via Browser and from my pc it runs ok with default OracleProvider and with the custom OracleProvider with given applicationName attribute I need if somebody can give more light into these issues:
      1. Does OracleMembershipProvider provider works in the same way as AspNetSqlMembershipProvider as it is explained in the above noted article?
      2. If yes, what I am doing wrong and not have the applicationName column filled in neither case (when I use default OracleProvider with no provided applicationName and also in a case when I use custom OracleMemberShipProvider where I create applicationName)?

      3. Column username of table ora_aspnet_memebrship is empty, but applicationID and userID are entered, is this expected behavior?
      4. What does actually happen to these tables of OracleMemebrshipProvider (ORA_ASPNET_APPLICATIONS, ORA_ASPNET_MEMBERSHIP, and ORA_ASPNET_USERS) when you create user from Web Site Administration Tool and how they correlate to settings of the provider in web.config? I am using right now just authentication with no need for other features of the provider as role, profiles.

      Or if you can give me detailed link where I can read and find answers on these questions I would appreciate.

      Thank you,

        • 1. Re: OracleMembershipProvider Form Authentication
          I assume your passwordFormat="Hashed".

          Please try to add hashAlgorithmType="SHA1" in your application config, i.e. web.config,
          before using ASP.NET Web Site Administration Tool to create Membership users.
          For example,

          <membership defaultProvider="OracleMembershipProvider" hashAlgorithmType="SHA1"/>

          By default the value should be "SHA1".
          • 2. Re: OracleMembershipProvider Form Authentication
            I've got the same problem with my application.
            I'm using VS2008, NET 3.5, Oracle, ODP

            Authentication is working perfectly from ASP.NET Development Server.
            After deployment to IIS 5.1 each user login attempt failed with "Your login attempt was not successful. Please try again".

            "applicationName" property is correctly specified.

            Please, help.
            Thank you.
            • 3. Re: OracleMembershipProvider Form Authentication
              Please check authentication mode="Forms" in your application config file.
              When "passwordFormat"="Clear", the password should be stored in clear text.
              You may query ORA_ASPNET_USERS and ORA_ASPNET_MEMBERSHIP to
              check the password.
              • 4. Re: OracleMembershipProvider Form Authentication

                yesterday i decided to deploy Web site project from my Visual Studio environment to IIS 7 and guess what :) i found the described problem after hours of research and trying different things i got your threat. The clue about the application name worked for me(i put and the passwordFormat="Hashed" for the memvership provider). After that i succeed to login but i found another problem with the role provider. I have sitemap with security trimming enabled and it was not render right, cause the problem with the role provider. So in my web.config file i had:

                <membership defaultProvider="SomeOracleMembershipProvider" hashAlgorithmType="SHA1" >
                                    <add name="SomeOracleMembershipProvider" type="Oracle.Web.Security.OracleMembershipProvider, Oracle.Web, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionStringName="ConnectionString"/>
                          <profile enabled="true" defaultProvider="OracleProfileProvider">
                                    <add name="FullName" type="string"/>
                          <roleManager enabled="true" defaultProvider="OracleRoleProvider"/>

                Basically i aded 4 things and after that it worked:
                1) added passwordFormat="Hashed" in SomeOracleMembershipProvider properties;
                2) added applicationName="/SomeApp" in SomeOracleMembershipProvider properties;
                3) Predifiend the roleManeger and added SomeOracleRoleProvider;
                4) added applicationName="/SomeApp" in SomeOracleRoleProvider properties;

                After these 4 steps my web.congif is like this:

                <membership defaultProvider="SomeOracleMembershipProvider " hashAlgorithmType="SHA1" >
                                    <add name="SomeOracleMembershipProvider " applicationName="/SomeApp" passwordFormat="Hashed" type="Oracle.Web.Security.OracleMembershipProvider, Oracle.Web, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionStringName="ConnectionString" />
                          <profile enabled="true" defaultProvider="OracleProfileProvider">
                                    <add name="FullName" type="string"/>
                <roleManager enabled="true" defaultProvider="SomeOracleRoleProvider">
                <add name="SomeOracleRoleProvider" applicationName="/SomeApp" connectionStringName="ConnectionString" type="Oracle.Web.Security.OracleRoleProvider, Oracle.Web, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" />

                Hope it helps!

                Edited by: user13061006 on Apr 30, 2010 12:26 AM
                • 5. Re: OracleMembershipProvider Form Authentication

                  you saved me up hours of work! I used to have the same problem and now it's solved! Thanks a lot.

                  • 6. Re: OracleMembershipProvider Form Authentication
                    Thank you soooooo much you help me from the dead line,it works with me..
                    every thing now regarding the oracle providers with asp.net (sitemap ,role ,membership..) is working in both development and production in iis 7 is working now.
                    • 7. Re: OracleMembershipProvider Form Authentication
                      i followed exactly the same steps. the WAT recognizes oracleprovider but when i wanted add user through wizard or WAT i get error ....._create_user not declared
                      Do i need to do any configurations on Oracle?