login-webflow.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <flow xmlns="http://www.springframework.org/schema/webflow"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="
  5. http://www.springframework.org/schema/webflow
  6. http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
  7. <start-state idref="automaticCookiePathSetter" />
  8. <action-state id="automaticCookiePathSetter">
  9. <action bean="automaticCookiePathSetterAction" />
  10. <transition on="success"
  11. to="ticketGrantingTicketExistsCheckAction" />
  12. </action-state>
  13. <action-state id="ticketGrantingTicketExistsCheckAction">
  14. <action bean="ticketGrantingTicketExistsAction" />
  15. <transition on="ticketGrantingTicketExists"
  16. to="hasServiceCheck" />
  17. <transition on="noTicketGrantingTicketExists"
  18. to="gatewayRequestCheck" />
  19. </action-state>
  20. <action-state id="gatewayRequestCheck">
  21. <action bean="gatewayRequestCheckAction" />
  22. <transition on="gateway" to="redirect" />
  23. <transition on="authenticationRequired" to="viewLoginForm" />
  24. </action-state>
  25. <action-state id="hasServiceCheck">
  26. <action bean="hasServiceCheckAction" />
  27. <transition on="authenticatedButNoService"
  28. to="viewGenericLoginSuccess" />
  29. <transition on="hasService" to="renewRequestCheck" />
  30. </action-state>
  31. <action-state id="renewRequestCheck">
  32. <action bean="renewRequestCheckAction" />
  33. <transition on="authenticationRequired" to="viewLoginForm" />
  34. <transition on="generateServiceTicket"
  35. to="generateServiceTicket" />
  36. </action-state>
  37. <!--
  38. <action-state id="startAuthenticate">
  39. <action bean="x509Check" />
  40. <transition on="success" to="sendTicketGrantingTicket" />
  41. <transition on="error" to="viewLoginForm" />
  42. </action-state>
  43. -->
  44. <view-state id="viewLoginForm" view="casLoginView">
  45. <transition on="submit" to="bindAndValidate" />
  46. </view-state>
  47. <action-state id="bindAndValidate">
  48. <action bean="authenticationViaFormAction" />
  49. <transition on="success" to="submit" />
  50. <transition on="error" to="viewLoginForm" />
  51. </action-state>
  52. <action-state id="submit">
  53. <action bean="authenticationViaFormAction" method="submit" />
  54. <transition on="warn" to="warn" />
  55. <transition on="success" to="sendTicketGrantingTicket" />
  56. <transition on="error" to="viewLoginForm" />
  57. </action-state>
  58. <action-state id="sendTicketGrantingTicket">
  59. <action bean="sendTicketGrantingTicketAction" />
  60. <transition on="success" to="serviceCheck" />
  61. </action-state>
  62. <action-state id="serviceCheck">
  63. <action bean="hasServiceCheckAction" />
  64. <transition on="authenticatedButNoService"
  65. to="viewGenericLoginSuccess" />
  66. <transition on="hasService" to="generateServiceTicket" />
  67. </action-state>
  68. <action-state id="generateServiceTicket">
  69. <action bean="generateServiceTicketAction" />
  70. <transition on="success" to="warn" />
  71. <transition on="error" to="viewLoginForm" />
  72. <transition on="gateway" to="redirect" />
  73. </action-state>
  74. <!--
  75. The "warn" action makes the determination of whether to redirect directly to the requested
  76. service or display the "confirmation" page to go back to the server.
  77. -->
  78. <action-state id="warn">
  79. <action bean="warnAction" />
  80. <transition on="redirect" to="redirect" />
  81. <transition on="warn" to="showWarningView" />
  82. </action-state>
  83. <!--
  84. the "viewGenericLogin" is the end state for when a user attempts to login without coming directly from a service.
  85. They have only initialized their single-sign on session.
  86. -->
  87. <end-state id="viewGenericLoginSuccess"
  88. view="casLoginGenericSuccessView" />
  89. <!--
  90. The "showWarningView" end state is the end state for when the user has requested privacy settings (to be "warned") to be turned on. It delegates to a
  91. view defines in default_views.properties that display the "Please click here to go to the service." message.
  92. -->
  93. <end-state id="showWarningView" view="casLoginConfirmView" />
  94. <!--
  95. The "redirect" end state allows CAS to properly end the workflow while still redirecting
  96. the user back to the service required.
  97. -->
  98. <end-state id="redirect"
  99. view="externalRedirect:${externalContext.requestParameterMap['service']}${requestScope.ticket == null ? '' : (externalContext.requestParameterMap['service'].indexOf('?') != -1 ? '&amp;' : '?') + 'ticket=' + requestScope.ticket}" />
  100. <global-transitions>
  101. <transition to="viewServiceErrorView"
  102. on-exception="org.jasig.cas.services.UnauthorizedServiceException" />
  103. </global-transitions>
  104. </flow>