doubingjian2006 2012-03-07 10:48
浏览 45

ASP.NET自定义身份验证处理

We have a web app written by a third party in ASP.NET, we don't have access to the source code but do have access to the server it runs on. We now have had a new public website developed for us in PHP and need to add a login to the homepage that will allow users to access out ASP>NET app. Any ideas on the best way this can be achieved? Can we write a custom authentication handler to do this?

  • 写回答

1条回答 默认 最新

  • doushouxie7064 2012-03-07 16:25
    关注

    So authenticating from PHP by making a POST request to an ASP.NET application? And without having code access? AFAIK you'll be restricted to using HTTP methods rather than anything else to broker the request.

    The key is making the POST operation and consuming the response from ASP.NET and passing that to the client-side. I have tried this before but this was using an ASP Classic page with the request being generated from a winforms application. The principal is reasonably easy, POST over the username, password and associated details; then write out the authentication cookies. ASP.NET Forms Authentication will generate at least one cookie whose default name is '.ASPXAUTH', you may also find the session cookie ('ASP.NET_SessionId') depending on how the site handles sessions. One nice way of monitoring things is using Fiddler to see what is passed and returned back and forth.

    However, the problem I can envisage is your PHP page will be writing out the cookie for the domain hosting your PHP code and if the two sites are not co-existing in the same primary domain then while you might successfully authenticate, the ASP.NET site will not be able to read cookie created from a different domain. You might be able to get away with the php and ASP.NET servers running in the same sub-domain using the 'enableCrossAppRedirects' but this is something I'm not overly familar with.

    评论

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)