设为首页 收藏本站
查看: 884|回复: 0

[经验分享] Open Source and SOA, ESB and Security-HeidCloud

[复制链接]
发表于 2019-1-27 08:59:47 | 显示全部楼层 |阅读模式
Talend has donated an STS implementation to the Apache CXF community as posted already on this here
  This is the first part of a series of blogs on using WS-Federation Passive Requestor Profile to implement a Web and Web Services SSO solution from a web application to a target Web Service. The used technologies are CXF 2.5 (to be>

  •   Part I
      Configure and deploy CXF STS using Claims
  •   Part II

      Configure and deploy>
  •   Part III

      Configure and deploy Tomcat>
  •   Part IV

      Enhance Tomcat RP to call a target web services which delegates the>
  •   Part V

      Interoperability testing with Microsoft Windows>
  The STS in this part is configured to support the following functionality:

  •   STS WSDL is enriched with the WS-SecurityPolicy information
  •   STS issues a signed SAML 2.0 token
  •   STS is secured using HTTPS
  •   STS validates an incoming UsernameToken against a local file store
  •   STS adds claims information to the SAML token in an attribute statement
You can find a running maven project called services/sts here.  1. Username and password management
  The users and passwords are configured in a spring configuration file in WEB-INF/passwords.xml. The XML file has the following structure:
  
  
  
  
  
  The intention of this STS example is to illustrate how to set up an STS. If you have an LDAP directory in place or any other JAAS based LoginModule you can also plug in the WSS4J JAASUsernameTokenValidator.
  2. Claims management
  The claims for each user are configured in a spring configuration file also in WEB-INF/userClaims.xml. The XML file has the following structure:
  
  
  
  
  
  
  
  
  
  
  

  The claim>
  There is no standard URI for role. Therefore, I reuse Microsoft's role URI which is used by ADFS (Active Directory Federation Service) and Windows>  The intention of this STS example is to illustrate how to set up an STS. If you have an LDAP directory in place you can configure the LdapClaimsHandler where you configure the mapping of the claim>
  3. Project dependencies
  The STS has the following dependencies in the Maven project.
  2.5.2
  
         org.apache.cxf
  cxf-rt-transports-http
  ${cxf.version}
  
  
  org.apache.cxf
  cxf-rt-frontend-jaxws
  ${cxf.version}
  
  
  org.apache.cxf
  cxf-rt-ws-policy
  ${cxf.version}
  
  
  org.apache.cxf.services.sts
  cxf-services-sts-core
  ${cxf.version}
  
  
  4. STS endpoint configuration
  Setting up the STS involves several steps. The STS is configured using the spring framework. First step is to download Tomcat 7.
  4.1 Configure HTTP/S connector in Tomcat
  The HTTP connector should be configured with port 9080.
  The HTTPS connector in Tomcat is configured in conf/server.xml. Deploy the tomcatkeystore.jks of the example project  to the Tomcat root directory if the Connector is configured as illustrated:

  Update: Have a read through the following blog here which describes how to generate a keystore.
  4.2 Configure the WS-SecurityPolicies of the STS endpoint
  The following policies must be added to the WSDL. CXF provides other ways to correlate policies with a wsdl subject (port type, service, port, ...). I've chosen the simplest one where the policies are embedded into the wsdl for illustration purposes. The WSDL can be found in WEB-INF/wsdl/ws-trust-1.4-service.wsdl
  The following policy defines a transport binding (https) and expects a UsernameToken be present in the WS-Security header. The UsernameToken must be signed which is implicitly supported by HTTPS:
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  4.3 Configure TokenProvider
  This STS endpoint configuration only supports to issue SAML tokens (2.0 or 1.1). For a full list of the supported features by the STS check this blog.

  The configuration>  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  The last bean claimsAttributeProvider is described in section 4.5
  4.4 Configure Username/password authentication
  As described in section 1. the user and passwords are managed in the file WEB-INF/passwords.xml.
  To configure username/password authentication in CXF/WSS4J you must provide a CallbackHandler. The CallbackHandler is part of this example project.
  The configuration is located in the following spring configuration file (cxf-transport.xml):
  
  
  

  
  
  
  
  The bean upCallBackHandler implements the CallbackHandler which is configured as a jaxws property ws-security.callback-handler in jaxws:properties of the jaxws:endpoint configuration.
  4.5 Configure ClaimsManager

  Claims data can be stored in different kind of>
  The claims>      
  
  
  
  
  
  
  
  
  The bean userClaims is defined in the imported spring configuration file userClaims.xml.
  5. Deploy the STS to Tomcat
  To deploy the STS using Maven you have to follow these steps:

  •   Configuring the following maven plugin
      
      org.codehaus.mojo
      tomcat-maven-plugin
      1.1
      
      myTomcat
      http://localhost:9080/manager/text
      /${project.build.finalName}
      
      
  Add the server with username and password to your settings.xml
  Ensure the user has the role "manager-script" as described here
  Run mvn tomcat:redeploy
  (I recommend to use redeploy as deploy works the first time only)
If you use Tomcat 6, you must change the url of the tomcat maven plugin:  http://localhost:9080/manager
  6. Test the STS with SoapUI
  This is a sample request (called RST) to the STS:
  
  
  
  
  alice
  ecila
  
  
  
  
  
  http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0
  http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer
  
  
  
  
  
  http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue
  
  
  https://localhost:8081/doubleit/services/doubleittransportsaml1claims
  
  
  
  
  
  and this the expected response (called RSTR):
  
  
  
  
  
  http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0
  
  
  DoubleItSTSIssuer
  
  
  
  
  
  
  
  
  
  
  
  
  YIHAnHYol0pOs1Mc4MWhgwTP540=
  
  
  Mb3WfLefs0KziHe7NjhLUBsgfD2spr8M3HpqqhpO+yzIqMrw9eY1r7nFIh3nWeDOHY4odPBa0w06XDpzPGSzdmm9k/Ay+S6trtkgS/Hoi3sL8CGAmAHEPWSO4+td6MNrucdVhG9P+do6JflXDOppDroGh/YjvxpdosM55G2TbL0=
  
  REMOVED
  
  
  
  
  alice
  
  
  
  
  https://localhost:8081/doubleit/services/doubleittransportsaml1claims
  
  
  
  
  Alice
  
  
  Smith
  
  
  alice@mycompany.org
  
  
  
  
  
  
  #_ACF774CE2C8F387D9413183197088603
  
  
  
  
  _ACF774CE2C8F387D9413183197088603
  
  
  
  
  https://localhost:8081/doubleit/services/doubleittransportsaml1claims
  
  
  
  2011-10-11T07:55:08.872Z
  2011-10-11T08:00:08.872Z
  
  
  
  
  


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-668076-1-1.html 上篇帖子: Using GRE Tunnels with Open vSwitch 下篇帖子: 9.10 19.1
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表