italia / italia/spid-php-lib

Fixes needed in case "example" is in a subdirectory of the web path

Open
#119 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
29
Forks
37
PR merge metrics
No merged PRs in 30d

Description

there are several small fixes in the example directory in order to have all working:
- all absolute paths should be replaced by relative paths (eg "/login" => "./login")
- in file "views/smart-button.php" the extraProviders.entityName should be "testenv" and not "Testenv"

Here are the fixes I made:

## .htaccess
* spid.php is my temporary replacement to produce the response to the ajax request of my project
* logo/*.svg are the graphics of the IdP

`RewriteCond %{REQUEST_FILENAME} !index.php`
`RewriteCond %{REQUEST_FILENAME} !spid.php`
`RewriteCond %{REQUEST_FILENAME} !.*.svg`
`RewriteRule ^(.+)$ index.php/$1 [QSA,L]`

## index.php
changing the switch as in

`switch (basename($request_uri[0])) {`

and removing the initial slash from the cases.

## views/spid-smart-button/spid-button.min.js
the function "providers()" returns only 8 official providers, missing the 9th (lepida), as well as not providing the correct entityID (sielte).

## Cookie Same Site Policy
There seems to be an issue with the same-site policy: I had to add

`ini_set('session.cookie_samesite', 'None');`

before any call to session_start() to have successfull logins

Hope this can be helpful

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.