ivan-novakov / php-openid-connect-client

OpenID Connect Client Library
55 stars 21 forks source link

This is not working properly with OpenAM #2

Closed rghose closed 10 years ago

rghose commented 10 years ago

I am not getting any error_log messages in apache httpd so am really not being able to debug. I am using the first sample code specified in Readme.MD and this portion of the code:

try { $userInfo = $flow->process(); printf("%s", $userInfo); } catch (\Exception $e) { printf("Exception during user authentication: [%s] %s", get_class($e), $e->getMessage()); }

never gets executed.

ivan-novakov commented 10 years ago

Maybe I'm not getting this right, but the printf() function doesn't write to any log. It prints the value on the standard output.

And if the above code is not been executed, probably the GET parameter "redirect" is not set. It indicates, that the request is not an initial request, but a redirect from the OIC server and the URL with the redirect param must be registered at the OIC server as a redirect URI.

rghose commented 10 years ago

Well, I meant that part of the code was not being executed.

I added this:

try { _errorlog("check."); $userInfo = $flow->process(); printf("

%s
", $userInfo); _errorlog(serialize($userInfo));

to verify the same. However that part of the code does not get called.

What I understand is that, after someone clicks on Login the page will redirect to the provider which in turn redirects back to our server (the one using this library), and then it will show us the userInfo retrieved. Please point out my mistake. Thanks.

On Thu, Mar 6, 2014 at 8:09 PM, Ivan Novakov notifications@github.comwrote:

Maybe I'm not getting this right, but the printf() function doesn't write to any log. It prints the value on the standard output.

And if the above code is not been executed, probably the GET parameter "redirect" is not set. It indicates, that the request is not an initial request, but a redirect from the OIC server and the URL with the redirectparam must be registered at the OIC server as a redirect URI.

Reply to this email directly or view it on GitHubhttps://github.com/ivan-novakov/php-openid-connect-client/issues/2#issuecomment-36893506 .

Rahul Ghose Directi http://www.rahul-ghose.in

ivan-novakov commented 10 years ago

What server are you testing the client against?

The key is the redirect from the server - the URL should have the redirect GET parameter set. Then the code, you are refering will be executed. So if your test client page has the followinf URL:

https://example.org/client

Then you need to register the following redirect URL at the server:

https://example.org/client?redirect
rghose commented 10 years ago

True