【发布时间】:2015-02-20 16:53:39
【问题描述】:
我们正在使用 java、jersey 和 spring-security 构建一个 RESTful Web 应用程序。 设置了用于保护对 REST 资源的访问的 OAuth2 提供程序服务。
要请求有效的刷新令牌令牌,必须提供以下查询参数:
- 用户名
- 密码
- client_id
- grant_type
用户名/密码由前端的登录对话框提供:
但是当我检查应用程序的网络流量时,我看到以下 URL 经过,其中密码以明文形式显示:
在将请求 URL 发送到 OAuth2 提供程序时,是否有一种简单的方法可以隐藏请求 URL 中的密码? 是否可以通过 spring-security 配置来实现这一点?
这是我的授权服务器的 spring-security 配置:
<!-- Token management -->
<oauth:authorization-server client-details-service-ref="clientDetails" token-services-ref="tokenServices" user-approval-handler-ref="userApprovalHandler" token-endpoint-url="/oauth/token">
<oauth:authorization-code/>
<oauth:implicit/>
<oauth:refresh-token/>
<oauth:client-credentials/>
<oauth:password/>
</oauth:authorization-server>
【问题讨论】:
-
@javadev 这不是我要找的。我想在 oauth2 url 中隐藏密码,而不是在 spring 配置中隐藏密码...
标签: java spring rest spring-security oauth-2.0