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

Is there a way to use phpCAS within a Symfony API REST? #420

Closed
lazaro92 opened this issue May 19, 2022 · 1 comment
Closed

Is there a way to use phpCAS within a Symfony API REST? #420

lazaro92 opened this issue May 19, 2022 · 1 comment

Comments

@lazaro92
Copy link

lazaro92 commented May 19, 2022

Hi, I'm developing and application that needs to connect to a CAS service in order to see if the user logged via another application. The problem I have is that this library seems that is not designed for API REST and, when the front makes an AJAX call, the server sends a redirect to the service, but redirects don't work in AJAX calls.

So is there a wall that the API can send the route to go in a JSON instead of doing a redirect?

So phpCAS::checkAuthentication()), instead of make a redirection, it could return an object with the Location URL in order to make the redirection from the front application.

@lazaro92 lazaro92 changed the title Is there a way to use phpCAS within a Simfony API REST? Is there a way to use phpCAS within a Symfony API REST? May 19, 2022
@phy25
Copy link
Member

phy25 commented May 21, 2022

CAS works based off authentication server reading its cookies from the browser and passing the ticket back to the resource server, and generally there is no way for you to REST call authentication server without a ticket. I am afraid you need to work around it browser side by iframing the CAS login page to get the ticket for example. If you would like to learn more about CAS protocol, I recommend https://apereo.github.io/cas/6.5.x/protocol/CAS-Protocol.html

CAS - Enterprise Single Sign-On for the Web

@phy25 phy25 closed this as completed May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants