After CAs log in, callback other than the ticket parameter of custom parameters

Source: Internet
Author: User
Tags cas

In the technical selection of a project, the combination of easyui+cas+shiro+spring was chosen, and CAS implemented single sign-on, which made it easy to embed the pages of another application in one application to demonstrate the authorization aspects of the data involved.

Because Shiro will automatically jump to the page before login after the successful login, this makes the Ajax loading a fragment page or an IFRAME page in a framework such as Easyui. After logging in, it jumps directly to the URL of the Fragment page or IFRAME page, which makes the system less friendly to use.

Then decided to jump back to the page after each login success, then need to rewrite Shiro official Casfilter, in the Onloginsuccess method to use

Webutils.getandclearsavedrequest (Request);

Clears the URL information for pre-logon access that it has logged.

In another application that also uses the CAS service, an IFRAME reference is required to access a page of my current application that needs to be authorized to access, and a single sign-on across the application is also a login process, because I am in the face of the current application of the login changes into a successful login directly to the homepage, As a result, the page referenced in the IFRAME jumps directly to the home page when another application refers to my current application.

Based on the above problem, I decided to log in when the CAS returned to ticket, but also to return a token to indicate that the login page is normal or through ticket single sign-on, So I have the following CAS log-on after the return of the other than the ticket parameters of the custom parameters.

First, rewrite the following classes of CAs:

Both the Samlservic class and the Simplewebapplicationserviceimpl class are overloaded methods that add GetResponse based on the original class of CAs:

The extractserviceinternal method of the Casargumentextractor class and the Samlargumentextractor class is to return an instance of the class you wrote above.

The sendticketgrantingticketaction class is primarily to add a parameter ID (which is determined by the single sign-on access process for CAs):

Second, modify

In the configuration file

Change to the class you wrote.

Third, modify

In the configuration file

Change to your own class.

Iv. modification

In the configuration file

Change to your own class.

V. Configuration files

Add their own conditions to judge

This is my two or three years ago dry, when this step is simply recorded in the Word document, if there is an incorrect place, please correct me.

After CAs log in, callback other than the ticket parameter of custom parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.