DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: OAuth2 Server

Created:2010-02-18T17:33:18
Changed by:Robert Heel
Changed:2010-11-08T11:07:53
Classification:ods_oauth2_server
Keywords:oauth2, api, remote, server
Author:Robert Heel
Email:rheel@1drop.de
Info 4:
Language:en

img-1 img-2 EXT: OAuth2 Server - ods_oauth2_server

EXT: OAuth2 Server

Extension Key: ods_oauth2_server

Language: en

Keywords: oauth2, api, remote, server

Copyright 2010, Robert Heel, <rheel@1drop.de>

Onedrop Solutions GmbH & Co. KG

Sudetenstraße 26

93073 Neutraubling

www.1drop.de

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

Table of Contents

EXT: OAuth2 Server 1

`Introduction 3 <#__RefHeading__1493_1380477500>`_

What does it do? 3

Screenshots 3

`Administration 4 <#__RefHeading__1503_1380477500>`_

OAuth2 application management 4

Write an application 4

Connect to this application 4

`Configuration 6 <#__RefHeading__1507_1380477500>`_

Reference 6

`Known problems 7 <#__RefHeading__1515_1380477500>`_

`To-Do list 8 <#__RefHeading__1517_1380477500>`_

Introduction

What does it do?

Screenshots

img-3

Administration

OAuth2 application management

Add an OAuth2 Server Client record to the root page of your TYPO3 installation:

img-4

Write an application

You can take a look at the extension “ods_pushbuddy_helper”, which uses this extension.

Create a class, e.g. tx_example_server in class.tx_example_server.php:

<?php
Class tx_example_server {
      Function request($params, &$callingObj){
              $callingObj->setContentFormat('plain');
              $callingObj->addContent(1,'Hello World');
      }
}
?>

Use a hook in ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['remoteserver']['services']['example::module'] = 'EXT:example/class.tx_example_server.php:tx_example_server->request';

It's the same hook and syntax as the extension “remote_server” uses.

Connect to this application

Get an access code from ods_oauth2_server

GET: http://example.com/typo3/typo3conf/ext/ods_oauth2_server/api/au thorize.php

Parameters:

  • client_id=...
  • response_type=code
  • redirect_uri=http://example.com/

Exchange the access code against an access token:

POST: http://example.com/typo3/typo3conf/ext/ods_oauth2_server/api/t oken.php

Parameters:

Connect to your application

POST: http://example.com/typo3/typo3conf/ext/ods_oauth2_server/api/api.php

Parameters:

  • oauth_token=...
  • serviceID=example::module

TYPO3 only accept connection from known Browsers, please set an user agent, e.g.

curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla');

Configuration

Reference

Known problems

To-Do list

- Easy application and access token management

- Remove unused codes and tokens

img-2 8