2017 © Pedro Peláez
 

tao-extension extension-tao-oauth

Extension to easily configure an OAuth client for OAT platform.

image

oat-sa/extension-tao-oauth

Extension to easily configure an OAuth client for OAT platform.

  • Friday, July 27, 2018
  • by oat-lionel
  • Repository
  • 19 Watchers
  • 0 Stars
  • 1,145 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 24 Versions
  • 28 % Grown

The README.md

extension-tao-oauth

Extension to easily configure an OAuth client for OAT platform., (*1)

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:, (*2)

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:, (*3)

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., (*4)

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

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

Example:, (*6)

   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' \

The Versions

27/07 2018

dev-master

9999999-dev http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

27/07 2018

dev-develop

dev-develop http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

27/07 2018

v1.1.1

1.1.1.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

27/07 2018

dev-release/v1.1.1

dev-release/v1.1.1 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

15/06 2018

v1.1.0

1.1.0.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

14/05 2018

v1.0.3

1.0.3.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

14/05 2018

dev-fix/remove-unused-code

dev-fix/remove-unused-code http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

04/05 2018

v1.0.1

1.0.1.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

25/04 2018

dev-fix/basic_auth

dev-fix/basic_auth http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

20/04 2018

v1.0.0

1.0.0.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

18/04 2018

dev-release-1.0.0

dev-release-1.0.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

17/04 2018

dev-fix/default-accept-encoding

dev-fix/default-accept-encoding http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

11/04 2018

v0.2.2

0.2.2.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

23/03 2018

v0.2.1

0.2.1.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

22/03 2018

dev-release-0.2.1

dev-release-0.2.1 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

22/03 2018

dev-fix/update-readme

dev-fix/update-readme http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

20/03 2018

dev-feature/TAO-6107/sprint-73/added-role-for-consumer

dev-feature/TAO-6107/sprint-73/added-role-for-consumer http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

02/03 2018

dev-feature/TAO-5270_create-token-api

dev-feature/TAO-5270_create-token-api http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

23/02 2018

v0.0.6

0.0.6.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

28/11 2017

v0.0.5

0.0.5.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

01/09 2017

v0.0.4

0.0.4.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

01/09 2017

dev-release_0.0.5

dev-release_0.0.5 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

23/08 2017

v0.0.3

0.0.3.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment

18/08 2017

v0.0.2

0.0.2.0 http://www.taotesting.com

Extension to easily configure an OAuth client for OAT platform.

  Sources   Download

GPL-2.0

The Requires

 

by Camille Moyon

tao computer-based-assessment