twogether / network-sso
Twogether Network SSO Client
Installs: 30 978
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.2.9|^8.0
- ext-json: *
- ext-openssl: *
- firebase/php-jwt: ^5.2|^6.0
- twogether/laravel-url-signer: ^2.2
README
See the Vanilla PHP implementation for full documentation.
Important Note
Make sure your Session cookies and any other important login information have SameSite set to None.
Network API
Calling Remote APIs
To contact a remote API in the network, you will need a Bearer token. You can get one from the NetworkSSO object by calling
$token = $network_sso->getApiToken($user_id = null);
This will return a token that you can add to an Authorization header e.g:
$YourFavouriteHttpLibrary->addHeader('Authorization: Bearer '.$token);
If you pass in a user ID this will be sent to the remote API. Check with them whether that's expected or required.