Welcome Guest, Not a member yet? Register   Sign In
Can't get Params from URL with ?=
#1

[eluser]Unknown[/eluser]
I can use GET but is there a way to do this with URI class?

EDIT: This helped it not give a 404: http://ellislab.com/forums/viewthread/99570/
but I can't get it to recognize:
index.php/form/auth?ticket=ST-4388-NXthg3CtTwvbr5qCRDkf


I'm using CAS (Central Authentication Service) which is a web based external login form.

Here's a quick idea of what it does:

Quote:When your Web site is set up to use the Web Login Service it uses a
link on the login or main page of the site instead of an HTML form.
The link redirects the user to the Web Login Service which presents
them with a secure HTML form. To be authenticated, the user only
enters her UH username and password on the Web Login service's
secure HTML form.

After submitting her UH username and password the user is
redirected back to your Web site. Then, your Web site takes the
authentication token that the Web Login Service sent along with the
redirect and asks the Web Login Service to validate it. If the
user supplied the correct password the Web Login Service will
return a confirmation message to your Web site. Otherwise, a
rejection message is returned. The confirmation message will
include the user's UH username, UH number (uhUuid), and full name
(last, first middle initials).

From this, the Web site will know who the user is. The Web Login
service does not provide session tracking information so it is your
Web site's responsibility to handle session tracking. Session
tracking will reduce the number of round trips to the Web Login
Service to validate the user each time a resource (URL/URI) is
requested from your Web site.

My question is when the CAS service bounces the user back to my site I get a url like this:

index.php/form/auth/?ticket=ST-4317-mMnvPF9qCAE2DfGQFld9
I am also able to get this url if I play with some variables:
index.php/form/auth?ticket=ST-4388-NXthg3CtTwvbr5qCRDkf (notice the / before ? is now gone)
This seems possible to use with GET

This gives me a 404. I tried some ideas with grabbing the param with the URI class, but that is not working.

$ticket = $this->uri->segment(3,0);
$string = $this->uri->uri_string();
echo "This is Ticket parse it now: <b>$ticket</b> and string: <b>$string</b> <br/>";

After redirecting with the ticket in the path this is what it echos:

This is Ticket parse it now: 0 and string: /form/test

My next guess is to enable GET, but I don't know if this will work either, I'm going to try it anyways,

What would be a good way to get this ticket with CI?
#2

[eluser]LifeSteala[/eluser]
Can you make your URL return this? index.php/form/auth/ticket/ST-4388-NXthg3CtTwvbr5qCRDkf

Then you can use

$ticket = $this->uri->segment(4, false);




Theme © iAndrew 2016 - Forum software by © MyBB