Git Product home page Git Product logo

spid-cie-oidc-php's Introduction

SPID/CIE OIDC Federation Relying Party for PHP

spid-cie-oidc-php CI badge Apache license Get invited Join the #spid openid

The SPID/CIE OIDC Federation Relying Party for PHP

Summary

What is SPID/CIE OIDC PHP

SPID/CIE OIDC PHP is:

  • A PHP class library that helps to develop a relying party for SPID/CIE
    Are you a Developer and you want to make your own relying party or a plugin for your software?
    Read the Technical documentation.

  • A standalone proxy relying party for SPID/CIE
    You can simply setup the proxy project and configure the URL where to receive users's attributes. You can also choice how the attributes will be returned from the proxy, such as plain values, signed or encrypted.
    Read How to use as a proxy.

  • A generic OIDC to SPID/CIE OIDC relying party gateway
    Can your application connect to a standard OIDC Provider, but it doesn't have extended functionalities required by the SPID/CIE OIDC Federation? No problem, you can configure your client as a relying party to SPID/CIE OIDC PHP Provider and it will make the rest.
    Read How to use as a generic OIDC Provider.

Features

  • Interactive setup
  • Wizard for certificates generation
  • Bootstrap template
  • Hooks plugins
  • Simple API
  • Proxy functions
  • Ready to use

Setup

git clone https://github.com/italia/spid-cie-oidc-php.git
composer install

After setup go to /service_name/oidc/rp/authz where service_name is the service name configured during setup.

Example projects

Start the basic example project is as simple as run:

docker pull linfaservice/spid-cie-oidc-php
docker run -it -p 8002:80 -v $(pwd)/config:/var/www/spid-cie-oidc-php/config linfaservice/spid-cie-oidc-php

On the first run the setup will ask for configurations. All configurations will be saved in the ./config directory.

The repository also provides example projects to set up a complete SPID/CIE OIDC Federation.

Read how to set up a federation with the WordPress Example Project.
Read how to set up a federation with the Drupal Example Project.

Contribute

Your contribution is welcome, no question is useless and no answer is obvious, we need you.

Contribute as end user

Please open an issue if you've discoveerd a bug or if you want to ask some features.

Contribute as developer

Please open your Pull Requests on the dev branch. Please consider the following branches:

  • main: where we merge the code before tag a new stable release.
  • dev: where we push our code during development.
  • other-custom-name: where a new feature/contribution/bugfix will be handled, revisioned and then merged to dev branch.

In this project we adopt Semver and Conventional commits specifications.

Useful links

License and Authors

This software is released under the Apache 2 License by:

spid-cie-oidc-php's People

Contributors

damikael avatar peppelinux avatar rglauco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spid-cie-oidc-php's Issues

Errore "Failed to establish the Trust" all'invio della richiesta al sistema di federazione di test

Salve,
ho fatto il setup del progetto https://github.com/italia/spid-cie-oidc-django#setup e funziona tutto correttamente, riesco a fare un login con SPID.

Invece se mando la richiesta da questo progetto ottengo questo errore

Schermata 2023-06-23 alle 08 55 55

La riposta dalla federazione di test è:

/oidc/rp/redirect?error=invalid_request&error_description=Failed+to+establish+the+Trust&state=MTUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA

Sto eseguendo tutto in locale su localhost:9999 e ho configurato questo indirizzo come client_id

Nel log non vedo niente.

A cosa potrebbe essere dovuto l'errore?

E' possibile utilizzare anche il validator SPID per verificare il sistema?

[Doc] Document how to run/build the Docker image in the docker compose of a example Federation

[Doc] Document how to run/build the Docker image in the docker compose of a example Federation

Following this example
https://github.com/italia/spid-cie-oidc-django#docker-compose

all the example SPID/CIE RP projects must be configurable, runnable and usable in the docker-compose of the example federation.
Please provide a Dockerfile, and push the docker image to dockerhub or any other public repository of docker image, with instruction about how to build/pull it and how to configure it in the example federation compose file.

Usage as a generic library

Hi,

thank you for making this repo available for the community. I have a question about the possibility of using this package for generic OIDC Federation Relying Party (not for SPID or CIE), since usage as a library is (somewhat) indicated in the readme.

So, my intention is to use spid-cie-oidc-php federation related classes for entity statement, trust chain resolution, etc. in another OIDC RP package.

I have gone ahead and tried to instalall spid-cie-oidc-php as a dependency using composer

composer require linfaservice/spid-cie-oidc-php

I got a warning about missing / not known 'spid-sp-access-button' dependency. Then I added the following repo indication in my composer.json

"repositories": {
    "spid-sp-access-button": {
      "type": "package",
      "package": {
        "name": "italia/spid-sp-access-button",
        "version": "1.0.0",
        "source": {
          "url": "https://github.com/italia/spid-sp-access-button",
          "type": "git",
          "reference": "master"
        }
      }
    }
  },

After that, the composer installation was successful.

Next, my intention was to try to use EntityStatement class. The thing I encountered is this: I see in sample RP configs there is 'redirect_uri' property available, however I see that the redirect URI is hardcoded in method EntityStatement ::makeFromConfig() , and will not be correct for my RP, line

"redirect_uris" => array( $config['client_id'] . '/oidc/redirect' ),

Also, another example of hardcoded redirect_uri (not from config) is in AuthenticationRequest class, line

$redirect_uri .= 'oidc/rp/redirect';

In AuthenticationRequest class I also see SPID / CIE related configs and parameters set...

I guess this all was made on purpose, and since you have the whole TA/OP/RP containerized test environment available...

The question I'm trying to ask, is usage as a generic class library plausible at all or is this package intended as is, for SPID CIE? Is creating generic class library something that you would consider at all?

Some background: as part of GEANT Trust & Incubator activity we are searching for existing PHP OIDC Fed capable RPs, and came across this repo. We are planning on implementing OIDC Fed capable RP in SimpleSAMLphp: https://wiki.geant.org/display/GWP5/OIDCfed+support+on+SimpleSAMLphp

Coverage badge

Please add a badge in the README where the users can have the preview of the coverage reached in this project

Setup

Ciao,

forse mi è sfuggito qualcosa, ma non ho trovato documentazione a riguardo.

Quando eseguo composer install mi chiede diversi parametri e non sono sicuro come compilarli:

Nello specifico:

authority_hint con valore di default http://trust-anchor.org:8000/

Su questo non ho trovato informazioni neanche sulle linee guida.

redirect_uri

Ho lasciato quello proposto (in base al nome che ho dato all'enpoint del relying party):

/spid_openid/test.php

Forse dipende dal fatto di non avere compilato bene i parametri ma, quando cerco di andare su /spid_openid/oidc/rp/authz come descritto sulla guida va a cercare un file sqlite che non c'è:

../data/store-rp.sqlite

Unable to open database: bad parameter or other API misuse [C:\Sviluppo\QUESTIT\spid-cie-oidc-php-main\lib\OIDC\RP\Database.php:45]

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.