从saml2令牌生成oauth2令牌,用于adfs身份验证

pxq42qpu  于 2021-09-30  发布在  Java
关注(0)|答案(0)|浏览(345)
Old Implementation : Earlier I have implemented login with LDAP(Lightweight Directory Access Protocol)

在成功登录后生成oauth令牌,并在oauth令牌的帮助下用于保护api

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

使用saml(安全Assert标记语言)令牌进行单点登录。

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.` 

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题