简体   繁体   English

是否可以从Winforms应用程序登录到使用Spring Security的网站?

[英]Is it possible to login from a winforms application to a website which uses spring security?

I want to call a web service from my winforms application. 我想从Winforms应用程序中调用Web服务。 My application is written on c# and the webservice is secured using spring security. 我的应用程序是用c#编写的,并且使用spring安全性来保护Web服务。

Is it possible to login to the website and call that web service?. 是否可以登录网站并调用该Web服务?

If it is possible how to do that? 如果有可能怎么做?

Authentication can be setup in many ways with Spring Security. 可以使用Spring Security以多种方式设置身份验证。 For example: 例如:

<http pattern="/webservice/**" create-session="stateless" realm="TestRealm">
  <http-basic/>
  <intercept-url pattern="/**" access="ROLE_USER"/>
</http>

Then it is as simple as this to authenticate from C#: 然后,从C#进行身份验证就这么简单:

var request = (HttpWebRequest)WebRequest.Create(url);
request.Credentials = new NetworkCredential(username, pwd);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从另一个网站登录使用Spring Security的网站? - How to login on a website that uses Spring Security from another website? Spring Security:来自外部网站的呼叫无法重定向到我们的应用程序 - Spring Security : Call from external website unable to redirect to our application Spring Security从控制器登录 - Spring Security login from controller 如何从另一个 Java 应用程序登录到具有 Spring Security 的 Spring Boot API - how to login to a spring boot API that has spring security, from a another java application 是否可以将jsp登录表单用作Spring安全性的自定义登录表单 - Is it possible to use jsp login form as a custom login form for spring security Spring mvc / security:从spring security中删除登录页面 - Spring mvc / security : excluding the login page from spring security 在 Spring Security 配置中,所有人都允许的 URL 不可访问并重定向到登录 - In Spring Security config Urls which are permitted for all are not accessable and redirecting to login 是否可以创建使用Spring Jdbc和Mysql的独立JavaFx应用程序 - Is it possible to create standalone JavaFx application that uses Spring Jdbc and Mysql 为我的 spring boot 应用程序创建一个默认的安全登录页面 - Creating a default Security login page for my spring boot application 我的 Spring Security 应用程序不会超出登录页面 - My application with Spring Security don't go beyond login page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM