使用Postman测试春季安全性 [英] Testing spring security with Postman

查看:156
本文介绍了使用Postman测试春季安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Spring安全性配置了基于表单的身份验证。当我在Web应用程序中使用登录表单登录时,它可以正常工作。

I have configured a form-base authentication using Spring security. It works fine when I log in using the login form in my web application.

它也可以与cURL一起使用:

It also works with cURL:

curl --data "j_username=myname&j_password=mypassword" http://localhost:8080/test/j_spring_security_check --verbose

但是,我无法使用邮递员使用它:

However, I cannot make it works using Postman:

缺少了什么?我需要通过身份验证才能测试其他服务。

What is missing? I need to be authenticated in order to test other services.

推荐答案

最后,我设法通过使用邮递员拦截器Chrome扩展名

Finally I managed making Postman aware of authentication by using the Postman Interceptor chrome extension

启用扩展程序(通过单击Postman App中的卫星图标),您只需要使用Web的登录表单登录,然后就可以开始使用需要在Postman中进行身份验证的服务。

With the extension enabled (by clicking the satellite icon within the Postman App), you just need to log in using the login form of your web and then you can start using services that require authentication in Postman.

这篇关于使用Postman测试春季安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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