Spring:SecurityContextHolder.getContext().getAuthentication()在iFrame中返回Anonymousauthenticationtoken
该页面正在iFrame中运行(业务合作伙伴强迫我这样做)。 如果我在没有iframe的情况下运行页面,则此调用Spring:SecurityContextHolder.getContext().getAuthentication()在iFrame中返回Anonymousauthenticationtoken,spring,spring-security,Spring,Spring Security,该页面正在iFrame中运行(业务合作伙伴强迫我这样做)。 如果我在没有iframe的情况下运行页面,则此调用 SecurityContextHolder.getContext().getAuthentication(); 返回UsernamePasswordAuthenticationToken 但如果我在iframe中运行它,它将返回: Anonymousauthenticationtoken 如何在iframe中返回UsernamePasswordAuthenticationToken
SecurityContextHolder.getContext().getAuthentication();
返回UsernamePasswordAuthenticationToken
但如果我在iframe中运行它,它将返回:
Anonymousauthenticationtoken
如何在iframe中返回UsernamePasswordAuthenticationToken
谢谢请发布您的安全配置。检查
X-Frame-Options
选项。对于此页面,我没有启用X-Frame-Options
(没有这样的标题)。对于其他页面,我将X-Frame-Options
设置为sameorigin
。