Tag: oauth 2.0

Spring-Security-Oauth2:访问此资源需要完全身份validation

我正在尝试将spring-security-oauth2.0与基于Java的配置一起使用。 我的配置已完成,但是当我在tomcat上部署应用程序并点击/oauth/token url访问令牌时, Oauth生成以下错误: Full authentication is required to access this resource unauthorized 我的配置在Git中心,请点击链接 代码很大,所以请参考git。 我正在使用chrome postman客户端发送请求。 以下是我的要求。 POST /dummy-project-web/oauth/token HTTP/1.1 Host: localhost:8081 Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&client_id=abc%40gmail.com&client_secret=12345678 错误就像, Oauth的URL是安全的,但在配置中,我给予访问此URL的所有权限。 这个问题究竟是什么?

SpringBoot 1.5.x + Security + OAuth2

我有一个带有OAuth2安全性的Spring Boot REST API。 今天我将spring-boot-starter-parent从1.4.2升级到1.5.2 。 变化让我很困惑。 之前,我可以使用Postman测试我的REST API。 当我的访问令牌不正确或我没有特定资源的权限时,服务器响应如下: { “error”: “access_denied”, “error_description”: “Access is denied” } 现在它一直将我重定向到/login页面…当我登录时 – 它显示我的资源而没有任何OAuth2身份validation… 我试图禁用它,我发现了这个神奇的属性: security.oauth2.resource.filter-order = 3 该行关闭重定向到登录页面。 但是,我的问题是: 这两个版本在安全方面发生了什么? 这个“奇怪”的行是唯一有效的修复方法吗? 这个登录页面的目的是什么以及它正在使用什么身份validation(我检查了Google Chrome中的请求和响应,我看不到任何访问令牌和oauth2的东西,所以它只使用用户存储库?) 我的代码中一些更重要的部分: 的pom.xml org.springframework.boot spring-boot-starter-parent 1.5.2.RELEASE 2.1.0.RELEASE org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-actuator org.springframework.boot spring-boot-starter-security org.springframework.security.oauth spring-security-oauth2 ${spring-security-oauth.version} application.properties #other properties security.oauth2.resource.filter-order = 3 OAuth2.java […]

Spring Boot + Oauth2客户端凭据

我正在尝试使用带有客户端凭据流的Oath2来保护我在Spring Boot上的微服务。 顺便说一句,那些微服务只会通过中间件层互相交谈,我的意思是不需要用户凭证来允许授权(用户登录过程如Facebook)。 我在Internet上查找了示例,了解如何创建授权和资源服务器来管理此通信。 但是我刚刚找到了解释如何使用用户凭据(三条腿)来解释它的示例。 有没有人有任何示例如何在Spring Boot和Oauth2中做到这一点? 如果可以提供有关所使用范围的更多详细信息,则令牌交换将不胜感激。