Jan 24

Authentication services: using them from html pages

Posted in Uncategorized      Comments Off on Authentication services: using them from html pages

If you”re using the client authentication services on an ASP.NET page that has a ScriptManager control, then there”s nothing here for you. it”s safe to move on :,,)

On the other hand, if you”re using the client side files and you do need to integrate your page with the authentication of ASP.NET, then keep reading. In the CTP, the client side class initialized itself with the path to the service in the server side. As you know, the service is embedded in the System.Web.Extensions.dll and you can only access it if your request has a specific  path. So, the problem is knowing the path to the service so that you can set your AutorizationService with the correct path.

In the current release, the authentication service only responds to the Authentication_JSON_AppService.axd name and the url must point to the top folder of your web app. For example, if you”ve got an html page at the top of your web folder, you only need to indicate that path. On the other hand, if you have a page inside a subfolder, you do need to make sure that you”re forming the correct path. Here”s an example of initializing the path property of the AuthenticationService object from a page placed inside a sub-folder of the top web folder (note the ../ used in the path):

Sys.Services.AuthenticationService.set_path( “../Authentication_JSON_AppService.axd” );