ImageVerifierCode 换一换
格式:DOCX , 页数:22 ,大小:118.28KB ,
资源ID:4398837      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-4398837.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(cas原理Word文件下载.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

cas原理Word文件下载.docx

1、 casservlet-classorg.jasig.cas.web.init.SafeDispatcherServletinit-paramparam-namepublishContextparam-valuefalse/init-paramload-on-startup1/servletservlet-mappingurl-pattern/login/servlet-mapping.!- 其他cas servlet mapping -所有映射到cas servlet上的请求都将经过/WEB-INF/cas-servlet.xml检查确定进入哪个Action,cas-servlet.xml中

2、最重要的两个bean就是handlerMappingB和handlerMappingChandlerMappingB配置了登陆流程进入的路径映射,而handlerMappingC则配置了其他的流程的路径映射。/WEB-INF/login-webflow.xml流程配置文件即是在handlerMappingB中通过/login映射进入的。Webflow依据一个生成的flowExecutionKey来确定一个流程实例走到了哪一步,每次页面流程运转总是需要提交这个 flowExecutionKey来告诉webflow它是从流程的哪个位置出发的有了以上理论作为依据,我们在下一节就可以根据自己的需要修改

3、流程,使 之支持远程登录了服务器登陆流程修改目标修改后的登陆流程活动图如下:图中橙色为我们修改的流程节点,这里我们增加了一个开始节点remoteLogin和一个结束节点remoteCallbackView,删除了原有的loginFormView节点、 viewGenericLoginSuccess以及renew节点(renew节点由于系统无此需求而删除),然后将所有这些节点的转向全部都转向到remoteCallbackView节点,因为登陆和显示登陆成功信息都应该是客户端完成的服务器端实现目标好了,原理到这里已经啰嗦完了,下一节讲如何着手修改CAS服务器端啦。修改需要基于几个基本原则:不影响原

4、有统一登陆界面功能客户端应尽量保持简单尽量保证原有功能的完整性和安全性对于第三点,必须事先说明:将登陆页面放到客户端本身就是降低了CAS安全性,这意味着作为服务向外发布的CAS服务器中的用户密码有可能由于客户端的不安全性而导致泄露,整个CAS系统成为了一个“水桶形态”,整个CAS体系的安全性将取决于所有客户端中安全性最低的一个。这也是CAS官方一直不推荐的方式。服务器端修改接下来我们讲解服务器端修改的详细过程:首先,修改/WEB-INF/web.xml,为cas增加一个/remoteLogin的映射:/remoteLoginproperty name=mappingspropsprop key

5、=/loginloginController/remoteLoginremoteController/propertyinterceptorslistref bean=localeChangeInterceptor /list/bean然后在cas-servlet.xml文件中添加我们上面所配置的remoteController的bean:- 增加远程控制者,允许以/remote请求启动remote控制流程 -remoteLoginController class=org.springframework.webflow.executor.mvc.FlowController p:flowExe

6、cutor-ref=remoteLoginFlowExecutordefaultFlowId=remoteLogin-webflowargumentHandlerbeanorg.springframework.webflow.executor.support.RequestParameterFlowExecutorArgumentHandlerflowExecutionKeyArgumentName=ltflow:executor id= registry-ref=remoteLoginFlowRegistryexecution-attributesalwaysRedirectOnPause

7、value=false/flow:executorregistry id=location path=/WEB-INF/remoteLogin-webflow.xmlregistry可以看到上面将请求指向了webflow配置文件/WEB-INF/remoteLogin-webflow.xml文件,我们需要创建此文件并配置其成为我们所需的流程,以下是remoteLogin-webflow.xml全文:?xml version=1.0 encoding=UTF-8flow xmlns=http:/www.springframework.org/schema/webflow xmlns:xsi=/w

8、ww.w3.org/2001/XMLSchema-instance xsi:schemaLocation= http:/www.springframework.org/schema/webflow/www.springframework.org/schema/webflow/spring-webflow-1.0.xsdstart-state idref=remoteLogin- 远程登陆主要Action -action-state id=action bean=remoteLoginActiontransition on=error to=remoteCallbackViewsubmitbin

9、dAndValidatecheckTicketGrantingTicketticketGrantingTicketExistsCheck/action-state- 远程回调页面,主要以JavaScript的方式回传一些参数用 -end-state id= view=decision-state id=if test=$flowScope.ticketGrantingTicketId != null then=hasServiceCheckelse=gatewayRequestCheck/decision-state$externalContext.requestParameterMapgat

10、eway != &&externalContext.requestParameterMap= null & flowScope.service !=nullredirect else=$flowScope.service !generateServiceTicket- The warn action makes the determination of whether to redirect directly to therequested service or display the confirmation page to go back to the server. -$flow

11、Scope.warnCookieValueshowWarningViewauthenticationViaFormActionsuccess method=sendTicketGrantingTicketsendTicketGrantingTicketActionserviceCheckgenerateServiceTicketAction to =gateway end state is the end state for when the user has requestedprivacy settings (to be warned) to be turned on. It delega

12、tes to a view defines in default_views.properties that display the Please click here to goto the service. message.casLoginConfirmView end state allows CAS to properly end the workflow while stillredirecting the user back to the service required.bean:dynamicRedirectViewSelectorviewServiceErrorViewvie

13、wServiceSsoErrorViewglobal-transitionstransition to= on-exception=org.springframework.webflow.execution.repository.NoSuchFlowExecutionException /org.jasig.cas.services.UnauthorizedSsoServiceExceptionorg.jasig.cas.services.UnauthorizedServiceException/global-transitions/flow以上文件根据原login-webflow.xml文件

14、修改,黄色背景为修改部分。可以看到,我们在流程中增加了remoteLogin Action节点和remoteCallback View节点,下面我们配置remoteLogin节点:在/WEB-INF/cas-servlet.xml文件中增加remoteLoginAction配置:com.baidu.cas.web.flow.RemoteLoginActionargumentExtractors-ref=argumentExtractorswarnCookieGenerator-ref=warnCookieGeneratorticketGrantingTicketCookieGenerator-

15、ref=ticketGrantingTicketCookieGenerator同时创建com.baidu.cas.web.flow.RemoteLoginAction类:/* 远程登陆票据提供Action.* 根据InitialFlowSetupAction修改.* 由于InitialFlowSetupAction为final类,因此只能将代码复制过来再进行修改.* * author GuoLin*/public class RemoteLoginAction extends AbstractAction /* CookieGenerator for the Warnings. */ NotN

16、ull private CookieRetrievingCookieGenerator warnCookieGenerator; /* CookieGenerator for the TicketGrantingTickets. */ private CookieRetrievingCookieGenerator ticketGrantingTicketCookieGenerator; /* Extractors for finding the service. */ NotEmpty private List argumentExtractors; /* Boolean to note wh

17、ether weve set the values on the generators or not. */ private boolean pathPopulated = false; protected Event doExecute(final RequestContext context) throws Exception final HttpServletRequest request = WebUtils.getHttpServletRequest(context); if (!this.pathPopulated) final String contextPath = context.getExternalContext().getContextPath(); final String cookiePath = StringUtils.hasText(contextPath) ? contextPath :/;

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2