Download the PHP package ekoapp/eko-oauth-sdk without Composer
On this page you can find all versions of the php package ekoapp/eko-oauth-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package eko-oauth-sdk
EkoOAuthSDK-PHP
An OAuth authentication client for integrating 3rd party application with Eko App.
Prerequisites
Client application must be registered with Eko first. These values, redirect_uri
, client_id
, client_secret
and eko_uri
, will be defined during registration process.
Running Example
- Edit the
client_id
,client_secret
,redirect_uri
andeko_uri
in/examples/app.php
. - Go to
http://localhost/path/to/project/examples/app.php
via the browser
Installation
Usage
See examples/app.php
for the complete flow of usage.
1. Initialization
2. Authentication
To authenticate a user, the client application must redirect the user to the url below.
- Create a redirect url to Eko authentication endpoint
3. Get token and user info
The client application must setup an endpoint which must match the predefined redirect_uri
. After authentication success or fail, Eko will redirect the user back to this redirect_uri
endpoint along with state
and code
(authentication code) as query parameters. The client application must validate the incoming state with the one previously store on the session. Then, the client application use the code
to retrieve access token and use the access token to retrieve user info. DO NOT use the code
if state validation fail.
-
Validate state (if fail, exceptions will be thrown)
-
Get token
-
Get ID token
- Get user info
or a shortcut to retreive user info ...
- Get user info by
code
4. Refresh Token
Release
Version | Changes |
---|---|
1.0.0 |
|
Authors
- Jura Boonnom - Initial work - jura-b