<security:frame-options policy="" /> spring security中怎么配置允许从所有域名中嵌入
时间: 2024-02-21 18:59:57 浏览: 19
如果你想允许从所有域名中嵌入你的页面,可以在Spring Security的配置中添加如下的代码片段:
```xml
<http>
<!-- 其他配置 -->
<headers>
<frame-options policy="ALLOWALL"/>
</headers>
</http>
```
这里的`ALLOWALL`是一种特殊的选项,表示允许所有来源的iframe嵌入。注意,这种配置方式会降低你网站的安全性,因为它允许来自不受信任的域名的iframe访问你的网页,可能导致安全问题。因此,建议在必要的情况下使用,否则最好使用更加安全的配置方式。
相关问题
<security:frame-options policy="ALLOW-FROM" strategy="" value=""/> 这里的strategy和value应该填什么
`<security:frame-options>` 是用于指定是否允许在页面中嵌入 `<frame>`、`<iframe>` 或者 `<object>` 等嵌入式框架的安全标签。其中 `policy` 属性用于指定嵌入式框架的策略,其取值可以是以下三种之一:`DENY`、`SAMEORIGIN` 和 `ALLOW-FROM`,分别表示不允许嵌入任何框架、只允许在同源页面中嵌入框架、只允许在指定的来源页面中嵌入框架。
而 `strategy` 属性和 `value` 属性是用于指定 `ALLOW-FROM` 策略时允许的来源页面的。其中 `strategy` 属性用于指定指定来源页面的策略,其取值可以是以下两种之一:`ORIGIN` 和 `URI`,分别表示指定的值是一个域名或者一个 URL 地址。而 `value` 属性用于指定来源页面的具体值,如果 `strategy` 属性为 `ORIGIN`,则 `value` 属性应该填写一个域名,如果 `strategy` 属性为 `URI`,则 `value` 属性应该填写一个 URL 地址。
因此,如果你想要允许指定的来源页面嵌入你的页面中,则可以使用如下代码:
```
<security:frame-options policy="ALLOW-FROM" strategy="URI" value="https://example.com"/>
```
这样就允许了来自 `https://example.com` 这个地址的页面在其中嵌入框架。
sabre wp接口返回一下错误<?xml version="1.0" encoding="UTF-8"?> -<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> -<soap-env:Header> -<eb:MessageHeader soap-env:mustUnderstand="1" eb:version="1.0" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader"> -<eb:From> <eb:PartyId eb:type="URI">webservices.sabre.com</eb:PartyId> </eb:From> -<eb:To> <eb:PartyId eb:type="URI">WebConnectTraining@abacus.com.sg</eb:PartyId> </eb:To> <eb:CPAId>0R6G</eb:CPAId> <eb:ConversationId>webconnect@2023-05-28T00:02:44.1137</eb:ConversationId> <eb:Service eb:type="sabreXML">PO_PNRPricingRQ</eb:Service> <eb:Action>PO_PNRPricingRQ</eb:Action> -<eb:MessageData> <eb:MessageId>1775063235469771950</eb:MessageId> <eb:Timestamp>2023-06-02T06:32:27</eb:Timestamp> </eb:MessageData> </eb:MessageHeader> -<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"> <wsse:BinarySecurityToken EncodingType="wsse:Base64Binary" valueType="String">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESB!ICESMSLB\/RES.LB!1685203364457!7287!297</wsse:BinarySecurityToken> </wsse:Security> </soap-env:Header> -<soap-env:Body> -<PNRPricingRS Version="1.4.4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://webservices.sabre.com/sabreXML/2003/07"> -<Errors> <Error ErrorMessage="NO VALID TICKETING AGREEMENTS FOUND" ErrorCode="0"/> </Errors> </PNRPricingRS> </soap-env:Body> </soap-env:Envelope>
根据您提供的信息,这是一个SOAP错误响应,其中包含错误代码和错误消息。错误消息是“NO VALID TICKETING AGREEMENTS FOUND”,错误代码为“0”。这意味着没有找到有效的票务协议。您需要检查您的请求中是否存在正确的票务协议,并确保使用的票务协议与您所请求的操作兼容。如果问题仍然存在,请联系SABRE支持团队以获得更多帮助。