从 SAML2 令牌生成 Oauth2 令牌用于 ADFS 身份验证

时间:2021-06-15 07:07:08

标签: spring-boot spring-security oauth-2.0 saml-2.0 adfs3.0

Old Implementation : Earlier I have implemented login with LDAP(Lightweight Directory Access Protocol)

登录成功后生成Oauth Token,并在Oauth Token的帮助下用于保护API

New Implementation :I have implemented ADFS (Active Directory Federation Services ) 

使用 SAML(安全断言标记语言)令牌单点登录。

Challenge : I want to create Oauth Token(Encrypted string based token) from SAML Token (XML based response)

这样我就可以在登录后将 oauth 令牌传递给登录用户并保护我们的 api 对于向服务器发出的任何 api 请求(通过验证附加到 api 调用请求的 Oauth 令牌)。

Due to limitations of SAML2 Token , I want it to be converted into Oauth Token , I have used @EnableOauth2 annotation , but not getting the desired type of token and getting the casting exception 
error_description": "class org.springframework.security.authentication.UsernamePasswordAuthenticationToken cannot be cast to class org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken (org.springframework.security.authentication.UsernamePasswordAuthenticationToken and org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken are in unnamed module of loader 'app')"
Stuck over this since a long time and not getting any reference ..

This is my first post over stackoverflow so please excuse my mistakes and help me.

0 个答案:

没有答案