- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要使用两个不同的授权服务器(两个 Okta 实例)来验证来自作为后端 REST API 层的单个 Spring Boot 应用程序中的两个不同 Web 应用程序的身份验证 token 。
目前我有一台资源服务器使用以下配置:
@Configuration
@EnableWebSecurity
public class ResourceServerSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception{
http
.authorizeRequests().antMatchers("/public/**").permitAll()
.anyRequest().authenticated()
.and()
.oauth2ResourceServer().jwt();
}
}
spring.security.oauth2.resourceserver.jwt.issuer-uri=https://dev-X.okta.com/oauth2/default
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=https://dev-X.okta.com/oauth2/default/v1/keys
spring-security-oauth2-resource-server
和
spring-security-oauth2-jose
在我的 Spring Boot 应用程序中(版本 2.2.4.RELEASE)
jwkSetUri.X=https://dev-X.okta.com/oauth2/default/v1/keys
jwtIssuerUri.X=https://dev-X.okta.com/oauth2/default
jwkSetUri.Y=https://dev-Y.okta.com/oauth2/default/v1/keys
jwtIssuerUri.Y=https://dev-Y.okta.com/oauth2/default
RequestHeaderRequestMatcher
以匹配安全配置中的 header 值。我不能锻炼的是如何使用两种不同的
oauth2ResourceServer
与安全配置一起使用的实例。
最佳答案
使用 Spring Boot ,现在不可能开箱即用。
Spring Security 5.3 提供了执行此操作的功能(spring boot 2.2.6 仍然不支持 spring security 5.3)。
请看以下问题:
https://github.com/spring-projects/spring-security/issues/7857
https://github.com/spring-projects/spring-security/pull/7887
通过遵循我提供的链接,可以手动配置资源服务器以使用多个身份提供者。提供的链接主要是针对spring boot webflux的开发。对于基本的 Spring Boot Web 开发,请观看此视频:
https://www.youtube.com/watch?v=ke13w8nab-k
关于spring - 如何在同一个 Spring Boot 应用程序中使用多个 'JWK Set Uri' 值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60031919/
任何人都可以帮忙吗??我使用以下命令使用 jwk 在 python 中生成了一个 key ,并存储在一个变量 key 中 key = jwk.JWK.generate(kty='RSA', size=
是否有为 JWK 创建指纹(又名指纹)的标准规范方法? 从我阅读的内容来看,该标准似乎没有定义 kid应该指定,我觉得很奇怪。对我来说,它是最重要的,因为它是一个确定性的值,而不是一个需要查找表的值,
我实现了一个 rest 授权服务器,它使用 com.nimbusds:nimbus-jose-jwt:9.13 以 JWK 格式返回给定 keyId 的公钥包裹。代码看起来像这样: @RequestM
我正在尝试使用我提供的 JWK 签署一些数据。 到目前为止,我已经尝试使用 jwt.io 来做到这一点,标题是 { "alg" : "RS256", "typ" : "JWT" } 有效载荷是 { "
我正在使用 auth0,我有两个客户端(ios、react)和一个使用 go-auth0 的 Go 后端 API . 我按照文档做了一个 Verify 方法,看起来像这样: func Verify(h
我已经使用 JWT 和 OAuth2 实现了一个 spring boot 应用程序。私钥和公钥是通过使用带有 jks keystore 的 java keytool 生成的。生成的 .jks 文件被复
假设我有一个代表 RSA key 对的 python 结构,如下所示: rsa_key_pair = { 'private_key': '-----BEGIN PRIVATE KEY-----
我需要将 RSA 公钥转换为有效的 JWK。特别是 JWK 的值“n”和“e”是我正在努力解决的问题。在查看位于 https://www.rfc-editor.org/rfc/rfc7517#page
我正在尝试使用 python 中的公钥验证 idToken。 我首先将 JWK token 转换为 PEM,但是当我调用“解码”函数时,我看到“签名验证失败”异常。我错过了什么? # Long str
RFC 中有一个 RSA key : https://www.rfc-editor.org/rfc/rfc7516#appendix-A.1 {"kty":"RSA", "n":"oahUIoW
我在 Spring Boot 应用程序中使用了 Azure AD。问题是当我尝试使用 AADAuthenticationFilter 类验证 token 时,我在公司网络(互联网)中收到此错误,但是当
这个问题在这里已经有了答案: Convert a JSON Public/Private Key pair to rsa.PrivateKey and rsa.PublicKey (1 个回答) C
我正在遭受这个问题:无法检索远程 JWK 集:读取超时 我在 Spring boot 2.5.3 中使用 Java 11, 对于依赖项: spring-security-oauth2-jose 5.5
我有 JWT var signedJwt = "eyJhbGciOiJFUzI1NiIsImtpZCI6IjZjNTUxNmUxLTkyZGMtNDc5ZS1hOGZmLTVhNTE5OTJlMDAw
我正在尝试实现 openid-configuration/jwks 提供的公钥缓存我们的 JWT 提供商的端点。我想使用缓存值来验证传入请求的签名。我们希望有适当的缓存,以降低 jwks 端点的请求。
我正在尝试实现 openid-configuration/jwks 提供的公钥缓存我们的 JWT 提供商的端点。我想使用缓存值来验证传入请求的签名。我们希望有适当的缓存,以降低 jwks 端点的请求。
我正在尝试将我的 GO Web 服务器连接到 Amazon Cognito 进行身份验证。我正在使用 gorilla 的 jwt 中间件。我也在遵循 AuthO 的指南:https://auth0.c
我生成了一个 ECDH key 对,并从中获取了公钥。使用 nodejs 和加密库。 const ecdh = crypto.createECDH('secp384r1'); ecdh.generat
我正在开发一个 P2P 基础设施,它将包含来自一组不同应用程序的数据,并通过网络分发。这个 P2P 覆盖层由一组 Python Twisted 服务器组成。 我需要保证每个应用程序的每个用户所存储数据
Here 是一种在线工具,可将 JWK 转换为 PEM,反之亦然。 我想在 C++ 代码中使用相同的代码。 对于 JWK: { "kty":"RSA", "e":"AQAB", "kid
我是一名优秀的程序员,十分优秀!