Daniel,
Have you taken a lot at the phpCAS examples at https://github.com/apereo/phpCAS/tree/master/docs/examples? They are really detailed with a lot of comments explaining what is happening and even mentioning what things should be for testing and what should be removed when deploying in a production environment.
Doug
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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 cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/17c31784-1dd3-43ac-8989-14df184e425f%40apereo.org.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-...@apereo.org.
Daniel,
I would recommend “getting your feet wet” first by working with the example_simple.php script. Make sure to get this one working with your CAS server first and then build from there by working with the example_service.php which could act like your CAS protected API service and example_proxy_GET.php which could act like the client wanting to access your API.
Doug
From: cas-...@apereo.org [mailto:cas-...@apereo.org] On Behalf Of Daniel Hui
Sent: Friday, August 2, 2019 10:50 AM
To: CAS Community <cas-...@apereo.org>
Subject: Re: [cas-user] Newbie question, about CAS proxy and phpCAS
Hi Doug,
May I know which examples suit the use for me? One script for the API and another one for the Proxy. Thanks.
On Friday, 2 August 2019 10:47:02 UTC+8, Doug C wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to cas-...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/17c31784-1dd3-43ac-8989-14df184e425f%40apereo.org.
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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 cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/748f5d63-9018-48ce-a372-925eac316126%40apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/748f5d63-9018-48ce-a372-925eac316126%40apereo.org.
Did you first get the example_simple.php script working? If not, do that first. If you have I have often found that looking in the debug.log informs me as to what is going wrong and would suggest you look there. Also, I don’t think you mentioned which version of the CAS server you are running. If you are running an older version of the CAS server, you may not be running version 3.0 of the CAS protocol.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/f8d7b972-42a3-46fc-b4e9-e3f283b14e6c%40apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/f8d7b972-42a3-46fc-b4e9-e3f283b14e6c%40apereo.org.
Perhaps your web server doesn’t have write permissions to the location your debug.log is being written. Usually it is a good idea to create a subdirectory that gives such rights to the web server and then tell the script to put the debug.log there. I think a simple work around for the time being would be to change the permissions on the current debug.log file to give the web server ownership of it. If the file doesn’t exist yet, touch it, and then transfer ownership.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/83f6f0e5-ba53-4c45-af43-033e651165df%40apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/83f6f0e5-ba53-4c45-af43-033e651165df%40apereo.org.
This is probably the same issue as the debug.log files. The web server must have the ability to read/write the location where the proxy granting tickets are stored. There is probably some indication of this in the debug.log.
OR
Did you configure the CAS server to allow this service to proxy authentication? See https://apereo.github.io/cas/5.0.x/installation/Configuring-Service-Proxy-Policy.html.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/c0c542ea-9fd0-44ea-8264-f6f8399cf099%40apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/c0c542ea-9fd0-44ea-8264-f6f8399cf099%40apereo.org.
Are you testing this on an internal server that isn’t accessible to the CAS server?
The following is in your debug log:
The supplied proxy callback url 'MY_CLIENT_URL' could not be authenticated. Either 'MY_CLIENT_URL' cannot be reached, it is not allowed to exercise proxy authentication
If your MY_CLIENT_URL is not accessible from the CAS server then it will not be able to contact the callback server which in your scenario is the same as your client URL. Either that or the CAS server does not have a service registered for your service API that allows proxy authentication.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/5a779f89-51e6-467f-ad96-03bde8022022%40apereo.org.
If the callback URL is authorized by the service registry, and if the endpoint is under HTTPS and protected by an SSL certificate, CAS will also attempt to verify the validity of the endpoint’s certificate before it can establish a successful connection. If the certificate is invalid, expired, missing a step in its chain, self-signed or otherwise, CAS will fail to execute the callback.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/5a779f89-51e6-467f-ad96-03bde8022022%40apereo.org.