Add jsp page to CAS server - spring

I'm newbie in using CAS and wanted to add a custom jsp page to the server after the login page and before it redirects to the client after successful login. I searched and thought that this would be done by adding the jsp page say Test.jsp in /WEB-INF/view/jsp/default/ui/Test.jsp and then changing the login-webflow.xml but i have little knowledge of Spring framework and failed in implementing using this technique as it redirected as usual, I wanted to know what all steps i'm missing or what would be the correct way to do it. Thanks in Advance.

Related

General Approach to redirect user after successful new/edit

Im working with Spring Boot and Thymeleaf. I want to redirect user after submitting succesfully a submit form (page B) to the page from which the user came from (page A). The easiest case is case page A -> page B -> page A. I found several post already:
Get the page that redirected you here, Spring MVC.
Author states that 3 solutions exist:
Add a hidden form attribute which contains the current page.
Use the referer request header to determine where the request came from.
Submit the form through ajax so that you stay on the current page.
Are there more modern approaches for this problem in thymeleaf + spring? I came across Spring Webflow but that seems overkill for my problem and outdated.
Thanks in advance!

Spring security logging form inside another page

I have found really lot of examples, how to make spring security custom logging page and how to configure redirect to it if authorization is needed.
But I can’t find how to make logging form inside another page, for example inside home.html.
I can imagine I will use Thymeleaf fragments to insert custom logging page inside home page. But I don’t know how to connect it to authentication process (also without any redirection to home.html)
Thank you for replies
Petr

Working with AJAX and JSP

Basically I just learnt AJAX yesterday and still learning. I have a project right now which requires me to write a Web Service method to search for shops. Everything is find but then again, I'm calling the web service using JSP, I would like to display the result using AJAX.
When I test my AJAX, it works when I integrate it with PHP file but may I know if it works for JSP kind of file? If so, is there any tutorial that show steps for me to learn?
If another case, if AJAX couldn't be perform using JSP, is there any other way for me to use AJAX with my Web Service?

HTML/Javascript login page using CasperJS

I've been trying to login to write a script using CasperJS that logs in to my work's router login page, and I'm a little lost...
The html for the login page is here: https://dl.dropboxusercontent.com/u/30314127/help.rtf
Thanks in advance,
Ronka
I'm not sure anybody is going to write the code you need. Casperjs has pretty good documentation. You need to request the page, find the id's of the login and sendKeys. I haven't run into any issues of not being able to log into a web based application using casper. IF you're completely at a loss I have a video you can watch which enters data into an Ajax application, which shouldn't be too much different than what you're trying to do.
Filling out Ajax forms

Using securesocial services without using its views

I started integrating SecureSocial in my play/scala app, but I don't really like all the redirects it does between it's different views.
example - try to login from it's default login page and if you put in a wrong pass you will be redirected to a different page (url) but with the same login form. the only thing that is different is that there is an error message...
I want a simple login form (user/password provider) at the corner of my main page that submits it's data using ajax, this data is validated on the server and a response is made to either display error message/s or change the window.location.
Next to this form I will put a link to go to a more advanced login page that adds the option to use other providers like fb/twitter etc..
But from that page I also want to use ajax to submit the details and get the response.
I tried to browse into the SecureSocial source but got a little lost in there.
Can any one give me an idea how to use SecureSocial's but without using any of it's views?
NOTE: I'm not interested in customizing their views, It's not just a CSS/design issue, I want to handle the login details Ajaxly and not with normal form submission followed by redirects...
After some more rummaging around in SecureSocial code I got a better understanding of how it operates.
You can use any of the providers you listed in the play.plugins file seperatly to authenthicate the user's info from your own login/auth code. just make sure you send the right parameters that the provider needs.
I liked the way SecureSocial's ProviderController class dynamically decided what provider to use, based on a parameter. But I didn't like the responses it made - redirect.. I wanted to respond to an ajax request with some data and let the client side js handle it.
This is my solution:
pretty much copy all of ProviderController code to my own Auth.scala file (a Controller).
Changed the redirects related to "case ex, case _", kept the redirect on successful auth as it adds the SecureSocial session key related to the user.
Removed all the SecureSocial related routes from my routes file.
Put an additional hidden field with the logintype (userpass/google/fb/etc...) and configured my login ajax post to sent this along with the post to my Auth controller.
If you need more info comment here and I'll edit the answer.

Resources