JAX-WS,身份验证和授权 - 如何? [英] JAX-WS, Authentication and Authorization - How to?

查看:1086
本文介绍了JAX-WS,身份验证和授权 - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是做Web服务的身份验证和授权的最好办法?

What is the best way to do authentication and authorization in web services?

我正在开发一套网络服务,因此需要基于角色的访问控制。
利用地铁 - SOAP,简单的java不使用EJB

I am developing a set of web services, requiring role based access control. Using metro - SOAP, simple java without EJBs.


  • 我想验证用户只是一个时间,使用用户名和
    密码以针对数据的基础上进行匹配。在随后的电话。

  • 我想使用某种类型的会话管理。可能会有一些
    会话ID,在登录检索到客户端,将在所有psented $ P $
    来电。

到目前为止:


  • 读<一个href=\"http://stackoverflow.com/questions/1613212/jax-ws-and-basic-authentication-when-user-names-and-passwords-are-in-a-database\">使用认证数据库 - 但我想应用程序级验证;


  • 身份验证与JAX-WS 的 - 但我不希望每次都做认证机制;

  • Read authentication using a database - but I want application level validation;
  • Read application authentication with jax-ws - but i don't want to do the authentication mechanism every time;

我想我可以使用SOAP处理程序,拦截所有的消息,并做了投手的授权控制,使用一些会话标识符标记,附带的消息,可以对保存的标识符匹配在数据的基础上,在登录网络的方法。

I think I can use a SOAP Handler, to intercept all the messages, and do the authorization control in the hander, using some session identifier token, that comes with the message, that can be matched against an identifier saved in the data base, in the login web method.

编辑:

我仍然有一些问题:


  • 如何知道Web方法的名字被称为?

  • 我应该使用什么样的令牌?

  • 如何通过电话之间此令牌?

编辑2

由于@的ag112答案:

Because of @ag112 answer:

我使用Glassfish的。

I'm using Glassfish.

我使用的WS-Policy和WS-Security加密和签名的消息。使用手动认证证明。我想补充的应用程序之间的消息级安全性,身份验证和授权的用户也在消息级别。

I use WS-Policy and WS-Security to encrypt and sign the messages. Using Mutual Certificate Authentication. I would like to complement this message level security between applications, with the authentication and authorization for the users also in message level.

我刚开发的服务,我不知道几乎没有什么客户,只要他们可以用不同的语言来创建。

I am just developing the services, and I don't know almost nothing the clients, just that they could be created in different languages.

在这一点上,我认为最重要的事情是做什么都我需要做认证,认证用户,我为客户端应用程序执行的最简单的方法。

At this point I think the most important thing is to do what ever I need to do to authenticate and authentication the users, I the most easy way to be implemented for the client applications.

推荐答案

所有帮助后,我创建了这个答案,以简化和总结所有讨论的想法。

After all the help, I create this answer to simplify, and summarize all the ideas that was discussed.

该问题有两个先决条件:

The questions has 2 requisites:


  • 消息层安全性;

  • 有一次验证。

通过ag112的帮助下,这是很难做到的,或优雅的任何方式。因此,这里有下结论:

With ag112 help, this is hard to do, or to elegant in any way. So here are to conclusions:


  • 有关消息级安全发送用户
    凭据每次(将其放置在SOAP头);

  • 一次性认证使用传输层安全性,并做了
    会话管理。

我preFER第一位的,因为消息的水平是最大的必要条件。

I prefer the first one, because the message level was the biggest requisite.

这篇关于JAX-WS,身份验证和授权 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆