开发者

Open protected web page passing in credentials programmatically

开发者 https://www.devze.com 2022-12-24 08:31 出处:网络
I have code examples from some of my previous work that help me to post form values to a web page (login credentials) and retrieve the text from that page.Now I want to pass in form values (login cred

I have code examples from some of my previous work that help me to post form values to a web page (login credentials) and retrieve the text from that page. Now I want to pass in form values (login credentials ag开发者_StackOverflow中文版ain) but actually open that web page in a browser given those credentials.

How do I do that? I'm not doing anything nefarious. In our CRM app (home-grown as it is), I want to create a link button that opens our web site's protected products page given the user's credentials (based on the user's login credentials). Normally, I'd copy the user's credentials in our login page which then takes me to the products page. I'm trying to do this now by just clicking a link button.

Any suggestions?


How are you launching the browser? Is this an internal network app? If so, I would recommend using Windows Authentication for your ASP.NET app, and then you don't have to worry about passing credentials. If you can't do that, then you'll probably have to pass the credentials on the querystring generated by your CRM app. Obviously, this is a huge security risk. But the next step would be to perform your internal authentication and then call FormsAuthencation.RedirectFromLoginPage or FormsAuthentication.SetAuthCookie().

0

精彩评论

暂无评论...
验证码 换一张
取 消