As mentioned in all the other responses, security wise this is NOT a good
idea.
But sometimes your boss just wants this and you can't refuse. So I added a
little javascript to the login page:
$(document).ready(function(){
var params = {},
search = window.location.search.substr(1);
search.replace(/([^?=&]+)(=([^&]*))?/g, function(p0, name, p2, value) {
params[name] = decodeURIComponent(value);
});
if (params.usr && params.pwd && $('#fm1').length && !$('#msg').length) {
$('#username').val(params.usr);
$('#password').val(params.pwd);
$('#fm1 [type=submit]').click();
}
});
Note: I used 'usr' and 'pwd' parameters so CAS doesn't confuse them with
the inputs named 'username' and 'password'.
Op donderdag 2 februari 2017 21:47:23 UTC+1 schreef Richard Yang:
>
> I am using cas 4.2.7
> http://localhost/cas/login?username=xxx&password=yyyy just gives me the
> default cas login page.
> I understand I may need to attache a "login ticket" if not submitting a
> login form, but how to get a login ticket?
>
> The reason I want to use the cas login api in http request is to integrate
> cas sso with our existing login page.
> Please do not tell me I can custom my current login page with cas's jsp
> form based login. It is just too much work and jsp to us is a very old
> technology and not to be considered for new development.
>
> Thanks.
>
> Richard
>
--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/c716da32-4e6c-4b4a-8fe6-daa7d0fe9c82%40apereo.org.