Code Monkey home page Code Monkey logo

cakephp-simplesamlphp-plugin's Introduction

Hi there ๐Ÿ‘‹

cakephp-simplesamlphp-plugin's People

Contributors

saji89 avatar scith avatar zl4bv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cakephp-simplesamlphp-plugin's Issues

SAML SSO in cakephp application

Hi,
I want to integrate simpleSAMLphp in my cakephp applicatiob. For this I have read this link: https://github.com/zl4bv/CakePHP-simpleSAMLphp-Plugin, at this link following code is written in Readme file:
Configure::write('Saml.SimpleSamlPath', '/path/to/simpleSAMLphp');
Which path I will give here: '/path/to/simpleSAMLphp'. Is this is the path of simpleSAMLphp application that is installed at separate location or this is the path of cakephp simpleSAMLphp plugin?

I do not want to make a separate simpleSAMLphp application instead this I want to put simpleSAMLphp code in my cakephp application, is this is possible?

My simple requirement is : I want to use simplesamlphp as a Library instead of application. Please suggest me steps to follow for this.

SimpleSAML_Error_NoState: NOSTATE after login

I'm trying to configure SimpleSAMLPHP using CakePHP, in the project using just PHP it works fine but using CakePHP-simpleSAMLphp-Plugin I received the errors when I try to access the view :

    Warning (4096): Argument 1 passed to SamlAuthenticate::unauthenticated() must be an instance of Controller, instance of CakeRequest given, called in C:\Users\Alessandro\workspace\RW1\Projetos\Intranet\lib\Cake\Controller\Component\AuthComponent.php on line 348 and defined [APP\Plugin\Saml\Controller\Component\Auth\SamlAuthenticate.php, line 49]
    Warning (4096): Argument 1 passed to SamlComponent::login() must be an instance of mixed, none given, called in C:\Users\Alessandro\workspace\RW1\Projetos\Intranet\app\Controller\UsersController.php on line 23 and defined [APP\Plugin\Saml\Controller\Component\SamlComponent.php, line 86]
    Notice (8): Undefined variable: url [APP\Plugin\Saml\Controller\Component\SamlComponent.php, line 87]
    Warning (4096): Argument 1 passed to SimpleSAML_Auth_Simple::login() must be of the type array, null given, called in C:\Users\Alessandro\workspace\RW1\Projetos\Intranet\app\Plugin\Saml\Controller\Component\SamlComponent.php on line 87 and defined [C:\xampp\simplesaml\lib\SimpleSAML\Auth\Simple.php, line 100]
    Warning (2): array_key_exists() expects parameter 2 to be array, null given [C:\xampp\simplesaml\lib\SimpleSAML\Auth\Simple.php, line 102]
    Warning (2): array_key_exists() expects parameter 2 to be array, null given [C:\xampp\simplesaml\lib\SimpleSAML\Auth\Simple.php, line 108]
    Warning (2): array_key_exists() expects parameter 2 to be array, null given [C:\xampp\simplesaml\lib\SimpleSAML\Auth\Simple.php, line 110]
    Warning (2): array_key_exists() expects parameter 2 to be array, null given [C:\xampp\simplesaml\lib\SimpleSAML\Auth\Simple.php, line 120]
    Warning (2): Cannot modify header information - headers already sent by (output started at C:\Users\Alessandro\workspace\RW1\Projetos\Intranet\lib\Cake\Utility\Debugger.php:801) [C:\xampp\simplesaml\lib\SimpleSAML\Utilities.php, line 585]
    Warning (2): Cannot modify header information - headers already sent by (output started at C:\Users\Alessandro\workspace\RW1\Projetos\Intranet\lib\Cake\Utility\Debugger.php:801) [C:\xampp\simplesaml\lib\SimpleSAML\Utilities.php, line 588]
    Warning (2): Cannot modify header information - headers already sent by (output started at C:\Users\Alessandro\workspace\RW1\Projetos\Intranet\lib\Cake\Utility\Debugger.php:801) [C:\xampp\simplesaml\lib\SimpleSAML\Utilities.php, line 589]

Redirect   
You were redirected to: https://mysaml:9443/samlsso?...

And after the login I received the return :

SimpleSAML_Error_NoState: NOSTATE
Backtrace:
2 C:\xampp\simplesaml\lib\SimpleSAML\Auth\State.php:225 (SimpleSAML_Auth_State::loadState)
1 C:\xampp\simplesaml\modules\saml\www\sp\saml2-acs.php:63 (require)
0 C:\xampp\simplesaml\www\module.php:134 (N/A)

I'm using CakePHP (2.5.2) and SimpleSAMLPHP (1.13.2)

SamlFormAuthenticate doesn't load settings

SamlFormAuthenticate isn't properly loading settings such as userModel

Apparently, SamlFormAuthenticate->_construct lacks a call to parent::__construct($collection, $settings);

How to configure the CakePHP site as a SP ?

Could you please provide an example showing how to add the CakePHP site as a SP on the simpleSAMLphp configuration? I'm struggling with the SingleSignOnService and SingleLogoutService URLs

I configured a SimpleSamlPHP working as a IDP
On the CakePHP site (the SP) I'm using both SimpleSamlPHP and Auth->FormAuthenticate

Thanks in advance

Question: Support For CakePHP 2.6.x ?

For updating cakePHP 2.10(for PHP7.x support)
This plugin worked for my CakePHP2.4.5 but for CakePHP2.6.0 didn't.

2019-03-12T15:13:17+09:00 ERROR - [InvalidArgumentException] The eventKey variable is required
Stack Trace:
#0 /var/www/html/test/lib/Cake/Controller/Component/AuthComponent.php(818): CakeEventManager->attach(Object(SamlAuthenticate))
#1 /var/www/html/test/lib/Cake/Controller/Component/AuthComponent.php(695): AuthComponent->constructAuthenticate()
#2 /var/www/html/test/lib/Cake/Controller/Component/AuthComponent.php(305): AuthComponent->_getUser()
#3 /var/www/html/test/lib/Cake/Utility/ObjectCollection.php(129): AuthComponent->startup(Object(MainMenuController))
#4 /var/www/html/test/lib/Cake/Event/CakeEventManager.php(243): ObjectCollection->trigger('startup')
#5 /var/www/html/test/lib/Cake/Controller/Controller.php(683): CakeEventManager->dispatch(Object(CakeEvent))
#6 /var/www/html/test/lib/Cake/Routing/Dispatcher.php(189): Controller->startupProcess()
#7 /var/www/html/test/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(MainMenuController), Object(CakeRequest))
#8 /var/www/html/test/app/webroot/index.php(117): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))

Do support this Plugin (forCakePHP=>2.6.0)?
I would appreciate if you could point out anything to me.
Pardon my broken English.

Application doesn't remember if user is logged in (via saml)

Is there any extra configuration I am missing? I followed your set up guide on the project homepage.

All pages (except login etc) are denied to guests (using $this->Auth->deny() in app_controller.php). I am using Saml.SamlForm - with both form and SAML authentication allowed. Log in with a form (@ /users/login), and user can access the site, browse pages no problem.

Login with SAML and user is always redirected back to the login page (/users/login). Any links will always redirect back to this page. If I print saml attributes, they are shown, and $this->Saml->isAuthenticated() returns true, but the application always redirects back to the Form login page. Is there more code I am missing so that Cake knows the user is logged in? Do I need to manually initialize a User (accessible from $this->Auth->User()) in the session? If so, what is the best way of achieving this?

I know the saml login is actually working as I can see a token cookie added when login is successful.

Many thanks for any pointers.
Sam

Question: What is the most efficient setup for SimpleSamlPHP?

Hello,
I was just wondering how you setup your own SimpleSamlPHP for it to work smoothly with CakePHP please?
I tried a standard setup but the SimpleSamlPHP sessions conflict with CakePHP sessions. I only managed to make it work by storing SimpleSamlPHP sessions in SQL but I'd prefer to use sessions.

Also it could be nice to have an "invisible" integration with Auth. Like being able to use $this->Auth->login() or logout() to do these actions both in SimpleSamlPHP and Auth. I did this on logout in my fork.

Thanks,

Error: Call to undefined method SamlAuthenticate::unauthenticated() File: /Users/teammember/Sites/sicake/lib/Cake/Controller/Component/AuthComponent.php Line: 345

I'm new to Cake and simpleSAMLphp. I have simpleSAMLphp running properly because I have it working with WordPress SSO Plugin.

So, I'm trying to figure out why I get this error when I follow your directions. Is the newest version of Cake too new for this plugin?

Error: Call to undefined method SamlAuthenticate::unauthenticated() File: /Users/teammember/Sites/sicake/lib/Cake/Controller/Component/AuthComponent.php Line: 345

Plugin to cake 3 conversion issues.

We have been tasked with implementing simplesaml login on a cake 3 project. We have been handed a pre-configured simpleSaml folder that if run without cakephp 3 allows the user to login and gain access to a page. We do not have access to the client's azure portal. We tried a custom cakephp 3 implementation, where after login we kept getting redirected to "https://blender.local/simplesaml/module.php/saml/sp/saml2-acs.php/azure-blender-sp".

Please keep in mind that we have next to no experience with saml or federation login in general. At this point we started to explore other options. Converting this plugin to work with cake 3 is an avenue that we decided to explore. I have converted and set up as well as I could. What I am mostly confused about is the simpleSaml work flow, and the server configuration. At the moment we are getting the exact same issue. We require login on an all actions within AppController. The user is redirected to the microsoft login portal. After successful login they are redirected to our site, but end up hitting "https://blender.local/simplesaml/module.php/saml/sp/saml2-acs.php/azure-blender-sp". At which point cake 3 then throws an error "Missing Controller".

In the set up instructions for this plugin I did not see anything in particular about: vhost setup, htaccess or custom actions to allow access to the simplesaml www folder. Since I do not have access to the "azure backend" it is difficult for me to confirm whether the issue lies with: our converted plugin, our cake setup, simpleSaml configuration or server setup.

Am I right in assuming that after login the redirect has to be directed to the simplesaml www directory? If so how did you manage that without cake picking up the navigation and trying to manage it via a controller?

Any advice would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.