Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

username parameter to login #39

Closed
kgk opened this issue May 29, 2012 · 5 comments
Closed

username parameter to login #39

kgk opened this issue May 29, 2012 · 5 comments

Comments

@kgk
Copy link

kgk commented May 29, 2012

We are writing an interface that queries the user id and then authenticates using either CAS, local, or openID. It would be great
if we could pass the username given to our interface to the cas login page page with something like

https:/somwhere.org/cas/login?id=kkvilekval&service=http://myservice.org/

Which would then present the user login with the form with the username field filled out.

[1] https://sites.google.com/site/oauthgoog/UXFedLogin/summary

@jfritschi
Copy link
Contributor

You can use something like this:

phpCAS::setServerLoginUrl('https:/somwhere.org/cas/login?id=kkvilekval');

The setServerLoginUrl() [1] function overrides the autogenerated login url. You can embedd any kind of parameters in this function.

[1] http://downloads.jasig.org/cas-clients/php/current/docs/api/group__internalConfig.html#gac2d9a37c0dca05e079b078ca67a9c325

@kgk
Copy link
Author

kgk commented May 30, 2012

I am not sure I understand your response.
Our web application has a single text field with
username or email:

We get the username or email and try to determine if the user authenticates with a CAS Server ..
If so.. then we redirect the browser to the CAS server and we would like to pass in the username id so the CAS server can generate the form with the ID pre-filled.

Thx,
K

@jfritschi
Copy link
Contributor

Are you using the phpcas library to do the authentication and redirection? If the answer is "yes" you have to initialize the phpcas like in any other app and simply override the login url with a custom login url where you can embedd your username as a variable.
It's similar to one of our examples. [1] Instead of overriding the validation url you simply override the login url with and url that includes your pararmeter. phpcas supports that this url contains any kind of other parameter any simply appends it's magic behind your definded url.
If you are not using the phpcas library you are on your own but doing a "header()" redirect to the cas server. This is fairly straight forward and can be seen in [2]. Just add whatever parameters you need but. You can still use phpcas for doing the validation but that will be tricky to do this "half" integration.

Regarding the cas server sided changes you might need to do a small login page customization to autofill the username field. I don't think that is supported out of the box.

[1]https://github.com/Jasig/phpCAS/blob/master/docs/examples/example_custom_urls.php
[2]http://downloads.jasig.org/cas-clients/php/current/docs/api/Client_8php_source.html#l01391

@kgk
Copy link
Author

kgk commented May 31, 2012

Hello,

On Wed, May 30, 2012 at 9:53 PM, Joachim Fritschi
reply@reply.github.com
wrote:

Are you using the phpcas library to do the authentication and redirection? If the answer is "yes" you have to initialize the phpcas like in any other app and simply override the login url with a custom login url where you can embedd your username as a variable.

No.. I've wriiten a python repose.who handler handling the CAS ticket
protocol. This works well
and during the normal login process we redirect to the CAS server (not
under my control).

It's similar to one of our examples. [1] Instead of overriding the validation url you simply override the login url with and url that includes your pararmeter. phpcas supports that this url contains any kind of other parameter any simply appends it's margic behind your definded url.
If you are not using the phpcas library you are on your own but doing a "header()" redirect to the cas server. This is fairly straight forward and can be seen in [2]. Just add whatever parameters you need but. You can still use phpcas for doing the validation but that will be tricky to do this "half" integration.

Regarding the cas server sided changes you might need to do a small login page customization to autofill the username field. I don't think that is supported out of the box.

I guess this is exactly what I am asking for.. An enhancement request
that the form be filled out
with the username if I pass it it during the initial redirection.

[1]https://github.com/Jasig/phpCAS/blob/master/docs/examples/example_custom_urls.php
[2]http://downloads.jasig.org/cas-clients/php/current/docs/api/Client_8php_source.html#l01391


Reply to this email directly or view it on GitHub:
#39 (comment)

Kristian G. Kvilekval (kkvilekval@gmail.com) 805-636-1599

@jfritschi
Copy link
Contributor

To my knowledge the automatic filling of the user field is not supported by choice by the cas server. Security being the main problem to my knowledge. The cas philosophy is that the cas server is the only server to recieve or gather credentials.

But you are currently filing an issue at the wrong project. phpcas is a cas client library in php. Your request is better suited at cas server project or the cas-user or cas-dev mailing list.

But in my view your request is a simple change in the /WEB-INF/view/jsp/default/ui/casLoginView.jsp of the cas server which you can do locally or you need to convince your cas server operators of.

Anyway i'm closing this issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants