Download the PHP package kompas/oauth2-client without Composer
On this page you can find all versions of the php package kompas/oauth2-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kompas/oauth2-client
More information about kompas/oauth2-client
Files in kompas/oauth2-client
Package oauth2-client
Short Description OAuth 2.0 Client Library
License MIT
Homepage https://github.com/kompascom/oauth2-client
Informations about the package oauth2-client
OAuth 2.0 Client Library
This library makes it stupidly simple to integrate your application with OAuth 2.0 identity providers. It has built in support for:
- Github
- Microsoft
- Vkontakte
- Kompas
Adding support for other providers is trivial.
The library requires PHP 5.3+ and is PSR-0 compatible.
First, you must install composer in your project.
Create a composer.json
file in your project root:
Add this line to your application’s index.php
file:
Usage for Kompas
Available Feature:
getRssLatest(token, service, siteno, sectionid)
getRssMostCommented(token, service, siteno, sectionid)
getRssMostPopular(token, service, siteno, sectionid)
setFilterBySite(sites)
*only in json
format
Example:
Kompas API Reference
Authorization:
Request body
-
HTTP request
POST http://apis.kompas.com/oauth2/token
-
Parameters Require body parameters
- client_id [Your registered client id]
- client_secret [Your registered client secret]
- grant_type [MUST value "client_credentials"]
-
Example
- Response
Kompascom: latest
Requires authorization
Request body
-
HTTP request
GET http://apis.kompas.com/rss/kompascom/latest
-
Parameters Require query parameters
- access_token [MUST value access token from authorization response]
Optional path parameters
- siteId [integer]
- sectionId [integer]
Optional query parameters
- filterBySite [string, delimeter with comma. ex: nasional,megapolitan]
-
Example all latests
-
Example latest with filter sites
-
Example latest for specific site
-
Example latest for specific section site
- Response
Kompascom: Most Commented
Requires authorization
Request body
-
HTTP request
GET http://apis.kompas.com/rss/kompascom/mostcommented
-
Parameters Require query parameters
- access_token [MUST value access token from authorization response]
Optional path parameters
- siteId [integer]
- sectionId [integer]
Optional query parameters
- filterBySite [string, delimeter with comma. ex: nasional,megapolitan]
-
Example all of most commented
-
Example most commented with filter sites
-
Example most commented for specific site
-
Example most commented for specific section site
- Response
Kompascom: Most Popular
Requires authorization
Request body
-
HTTP request
GET http://apis.kompas.com/rss/kompascom/mostpopular
-
Parameters Require query parameters
- access_token [MUST value access token from authorization response]
Optional path parameters
- siteId [integer]
- sectionId [integer]
Optional query parameters
- filterBySite [string, delimeter with comma. ex: nasional,megapolitan]
-
Example all of most popular
-
Example most popular with filter sites
-
Example most popular for specific site
-
Example most popular for specific section site
- Response
License
The MIT License (MIT). Please see License File for more information.