Wrox Programmer Forums
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 29th, 2006, 12:19 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default Atlas login scheme

Hi all.

 I've been playing with Atlas for a couple of hours now and want to AJAX enable my current application, but I've hit a showstopper.
There is a couple a things wrong right now

   1. When I compile and get the first page (login) I get two syntax errors (missing ; before statement), one in atlasglob.axd and one in the Atlas webservice JS file. When I examing the files they contain the login page??!? Must be something wrong with the config file (see below).
   2. I have a user class that implements MembershipUser and contains a lot of data. The it works right now is when a user hits the login button I validate the user, through my implementation of MembershipProvider (meaning that I can't use the Sys.Services.AuthenticationService.login method) and then get my user class through the GetUser method of my custom MembershipProvider. My user class then query the database for a lot of data. I don't want to do that with each request of course so I store the class in the ASP.NET Cache and write a authentication cookie with the FormsAuthentication class. After trying to get this scheme to work for a couple of hours I'm wondering - is it even possible with the Atlas webservice architecture?
   3. How do I set and redirect the user with a webservice?

Here is my (fairly long) web.config:

2    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
3      <configSections>
4        <!-- 
5            The sectionGroup define a section for ASP.NET Atlas.
6        -->
7        <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
8          <section name="converters" type="Microsoft.Web.Configuration.ConvertersSection" requirePermission="false"/>
9          <section name="webServices" type="Microsoft.Web.Configuration.WebServicesSection" requirePermission="false"/>
10         <section name="authenticationService" type="Microsoft.Web.Configuration.AuthenticationServiceSection" requirePermission="false"/>
11         <section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false"/>
12       </sectionGroup>
13       <section name="SQLPARAMETERPREFIX" type="System.Configuration.NameValueSectionHandler, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
14     </configSections>
15     <!-- 
16         The microsoft.web section defines items required for the Atlas framework.
17     -->
18     <microsoft.web>
19       <converters>
20         <add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
21         <add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
22         <add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
23       </converters>
24       <webServices enableBrowserAccess="true"/>
25       <!--
26         Uncomment this line to enable the authentication service.
27       -->
28       <authenticationService enabled="true"/>
29       <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved 
30            and modified in Atlas applications, you need to add each property name to the setProperties and 
31            getProperties attributes.  If you intend for all properties to be available, you can use "*"
32            as a shorthand rather than enumerating each property  -->
33       <!--  
34       <profileService enabled="true" 
35                       setProperties="propertyname1;propertyname2" 
36                       getProperties="propertyname1;propertyname2" />
37       -->
38     </microsoft.web>  
39     <appSettings>
41       <add key="XMLPath" value="C:\Inetpub\wwwroot\BookEvent\App_Data\" />
42       <add key="XMLSQLFileName" value="sqlStatements" />
43     </appSettings>
45       <add key="BookEventConnectionLocal" value="@" />
46       <add key="BookEventConnection" value="@" />
47       <add key="PrimemanagerConnection" value="@" />
49       <connectionStrings>
50           <remove name="LocalSqlServer"/>
51       <add name="BookEventConnectionLocal" providerName="FirebirdSql.Data.FirebirdClient" connectionString="hidden"/>
52       <add name="BookEventConnection" providerName="FirebirdSql.Data.FirebirdClient" connectionString="hidden"/>
53       <add name="PrimemanagerConnection" providerName="FirebirdSql.Data.FirebirdClient" connectionString="hidden"/>
54     </connectionStrings>
55     <system.web>
56       <pages>
57         <controls>
58           <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
59           <add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
60         </controls>
61       </pages>
62       <authentication mode="Forms">
63         <forms name=".BOOKEVENTAUTH" loginUrl="Login.aspx" path="/" />
64       </authentication>
65       <authorization>
66         <deny users="?"/>
67       </authorization>
68       <membership defaultProvider="BookEventProvider" userIsOnlineTimeWindow="30">
69         <providers>
70           <clear />

74           <add name="BookEventProvider"
75             type="BookEventMembershipProvider"
76             connectionStringName="BookEventConnection"
77             applicationName="BookEvent"
78             passwordFormat="Clear"/>
79         </providers>
80       </membership>
81       <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"
82         fileEncoding="iso-8859-1" culture="da-DK" uiCulture="da-DK" />
83       <compilation debug="true" defaultLanguage="c#">
84         <buildProviders>
85           <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
86         </buildProviders>
87       </compilation>    
88       <xhtmlConformance mode="Strict"/>
89       <httpHandlers>
90         <remove verb="*" path="*.asmx"/>
91         <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
92         <!--
93             The MultiRequestHandler enables multiple requests to be handled in one
94             roundtrip to the server. Its use requires Full Trust.
95         -->
96         <add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
97         <add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>
98         <!--
99             The IFrameHandler enables a limited form of cross-domain calls to 'Atlas' web services.
100            This should only be enabled if you need this functionality and you're willing to expose
101            the data publicly on the Internet.
102            To use it, you will also need to add the attribute [WebOperation(true, ResponseFormatMode.Json, true)]
103            on the methods that you want to be called cross-domain.
104            This attribute is by default on any DataService's GetData method.
106        <add verb="*" path="iframecall.axd" type="Microsoft.Web.Services.IFrameHandler" validate="false"/>
107        -->
108        <add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
109      </httpHandlers>
110      <httpModules>
111        <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
112        <add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>
113        <add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/>
114      </httpModules>
115    </system.web>
116    <!-- Uncomment this if your site globally denies access to anonymous users.  The 
117         authentication service and profile service are located under the virtual
118         "ScriptServices" directory.  Since you normally call the authentication web
119         service with an un-authenticated user, the following location tag can be used
120         to grant access to anonymous users.  If you use anonymous profile support
121         you will also need to grant access to anonymous users. -->
122    <location path="ScriptServices">
123      <system.web>
124        <authorization>
125          <allow users="*" />
126        </authorization>
127      </system.web>    
128    </location>
129    <system.data>
130      <DbProviderFactories>
131        <clear/>
133        <add name="FireBird Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description="FirebirdClient - ADO.NET 2.0 Data Provider" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Version=, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />
134      </DbProviderFactories>
135    </system.data>
136  </configuration>
 Any help would be appreciated!

Cheers, Jon.

 - mega
Moving to C# .NET
- mega
Aspiring JavaScript Ninja

Similar Threads
Thread Thread Starter Forum Replies Last Post
Atlas Problem aliirfan84 ASP.NET 2.0 Professional 3 May 24th, 2007 07:37 AM
How does SSL fit into the over scheme of Internet trents4life General .NET 0 November 20th, 2006 07:14 AM
atlas and web shop gtjr92 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 October 21st, 2006 03:38 AM
asp / atlas cbailey77 SQL Language 5 April 19th, 2006 01:52 PM
asp.net - atlas cbailey77 Visual Studio 2005 6 April 13th, 2006 10:48 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.