This repository has been archived by the owner on Nov 3, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Configuring custom redirect urls for unauthorized services
dima767 edited this page Dec 16, 2012
·
2 revisions
Since version 1.0.5
of cas-addons there is an ability to configure a custom redirect URL that will be followed after a login web flow ends in the case where a registered service is configured with disabledServiceUrl
extra attribute and has been disabled i.e. enabled=false
- Configure service(s) in
servicesRegistry.conf
{
"id":"1",
"serviceId":"https://www.google.com",
"name":"GOOGLE",
"description":"Test Google service",
"enabled":false,
"extraAttributes":{
"disabledServiceUrl":"https://example.com/mySuperUnauthorizedWarningPage"
}
}
- Redefine the standard
serviceAuthorizationCheck
bean inWEB-INF/cas-servlet.xml
<bean id="serviceAuthorizationCheck" class="net.unicon.cas.addons.web.flow.ServiceAuthorizationCheckWithCustomView">
<constructor-arg index="0" ref="servicesManager"/>
</bean>
- Redefine the standard
serviceAuthorizationCheck
action state inWEB-INF/login-webflow.xml
<action-state id="serviceAuthorizationCheck">
<evaluate expression="serviceAuthorizationCheck"/>
<transition on="success" to="generateLoginTicket"/>
<transition on="no" to="redirectToDisabledServiceUrl"/>
</action-state>
- Add the definition of
redirectToDisabledServiceUrl
end state inWEB-INF/login-webflow.xml
<end-state id="redirectToDisabledServiceUrl" view="externalRedirect:${requestScope.disabledServiceUrl}" />