Download the PHP package oat-sa/extension-tao-oauth without Composer

On this page you can find all versions of the php package oat-sa/extension-tao-oauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package extension-tao-oauth

extension-tao-oauth

Extension to easily configure an OAuth client for OAT platform.

Setting up OAuth

  1. At host server run console script to generate credentials: php index.php '\oat\taoOauth\scripts\tools\GenerateCredentials' -r $role . (final bash inliner may vary according to your server); It will return $key, $secret and $tokenUrl, which should be used to generate auth token. This data should be stored in your client env.

Response:

Client generated with credentials :
 - client key  : c35b263b78fa20aa560702a232fff5fc
 - client secret  : GSJ2z6xH3E3MelJbXA6AmQeQeYfCRueg3af9a92aba6bfc28559a8c5689adbc87fd901f18b00671e3bc5d5566f5af5e38
 - token url  : https://taotesting.com/taoOauth/TokenApi/requestToken
  1. If your client server works with Tao, you can run script which will import credentials to allow authentication against host server: php index.php '\oat\taoOauth\scripts\tools\ImportConsumer' -k $key -s $secret -tu $tokenUrl -r $role.

Using OAuth authentication

After generate of credentials you need to generate token for connections to the tao endpoints. For this you need to make request:

curl -X POST \
  https://taotesting.com/taoOauth/TokenApi/requestToken \
  -H 'Accept: application/json' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d 'client_id=c35b263b78fa20aa560702a232fff5fc&client_secret=GSJ2z6xH3E3MelJbXA6AmQeQeYfCRueg3af9a92aba6bfc28559a8c5689adbc87fd901f18b00671e3bc5d5566f5af5e38'

where $key and $secret your credentials from previous example.

It will return $access_token and $expires, which should be used to generate Authorization header:

  {
      "access_token": "hJFpTCo9Bvd30b7eb63ef28af1a7ce081252e9844053a9a4a38112ecb8c41eeedfd58f8907",
      "expires": 1521475157
  }
Request with OAuth Authorization header

Example:

   curl -X GET \
        'https://taotesting.com/taoDeliveryRdf/RestDelivery/getStatus?id=https%3A%2F%2Ftaotesting.com%2Ftao.rdf%23i15203488932024127 \
        -H 'Accept: application/json' \
        -H 'Authorization: Bearer hJFpTCo9Bvd30b7eb63ef28af1a7ce081252e9844053a9a4a38112ecb8c41eeedfd58f8907' \
        -H 'Cache-Control: no-cache' \
        -H 'Content-Type: application/json' \

All versions of extension-tao-oauth with dependencies

PHP Build Version
Package Version
Requires oat-sa/oatbox-extension-installer Version ~1.1||dev-master
league/oauth2-client Version ~1.4.0
oat-sa/generis Version >=14.0.0
oat-sa/tao-core Version >=47.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oat-sa/extension-tao-oauth contains the following files

Loading the files please wait ....