Download the PHP package authress/authress-sdk.php without Composer
On this page you can find all versions of the php package authress/authress-sdk.php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download authress/authress-sdk.php
More information about authress/authress-sdk.php
Files in authress/authress-sdk.php
Package authress-sdk.php
Short Description Client SDK for Authress authorization as a service. Provides managed authorization api to secure service resources including user data.
License Apache-2.0
Homepage https://authress.io
Informations about the package authress-sdk.php
Authress SDK for PHP
Installation & Usage
Install authress-sdk for usage of the API:
composer require authress/authress-sdk.php
SDK usage
There's a full working example in this repository for how to flow can look like: working example;
The full flow is usually:
- Check if user is logged in using
userSessionExists
- If user is not logged in send them to your login page
- On your login page ask the user which connection provider they want to use
- Call
authenticate
with thatconnectionId
- User will be redirected to the provider
- User will be returned to your redirectUrl
- The redirectUrl page should include a code snippet from the working example and in the URL of your page will contain the
iss
,code
, andnonce
parameters (for validation, you don't need to worry how to handle them, but they need to be there this signals that the login worked correctly.)
- The redirectUrl page should include a code snippet from the working example and in the URL of your page will contain the
-
Call the
userSessionExists
method- This should work and return
true
at this moment
You can also validate this worked by looking at the cookies for the app, which should contain
authorization
anduser
cookies. Please don't use these cookies directly as their format might change. - This should work and return
Authorization
Authentication
Log the user in with the selected identity provider connection. Use when the user isn't logged in yet.
Check if the user is currently logged in. If the user isn't logged in yet, call $authressClient->login->authenticate()
above.
Verify an incoming token into your service from a client:
All versions of authress-sdk.php with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
ext-openssl Version *
lcobucci/jwt Version ^4.1
guzzlehttp/guzzle Version >=6.5.6 || >=7.4.3