Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Índice

Índice
outlinetrue
stylenone
exclude.*ndice
stylenone

Objective

This document is intended for developers who want to create applications external to Fluig. Fluig has a public API and its main services are available on the platform. By using this API, you can create messages on behalf of the user, add contacts as favorites, create articles and much more. For the applications to act on behalf of the user the authorization is performed through the OAuth protocol.

...

Nota
titleObservation

Available from Fluig 1.1version

OAuth

Authentication and authorization of external applications to Fluig is performed via the protocolOAuth 1.0 and OAuth 1.0a which enables applications to perform actions on behalf of the user without storing their login information (username/password). You can also use the Fluig API through a valid session in the internet browser.

...

Nota
titleObservation

Fluig is not compatible with the OAuth 2.0 protocol.

...



Authentication process:

For an application to act in Fluig on behalf of a user or of itself it has to be previously registered on the Fluig platform with its public and private keys. As soon as the application is registered in Fluig it is possible to start the authentication process as steps below:

...

 

Figure 1 - OAuth example

 


Nota
titleObservação

To use the application, it must be previously registered in Fluig.

Register application in Fluig

To register an application in Fluig log in as Fluig administrator.

...

Deck of Cards
effectDuration0.5
historyfalse
idsampleshistoryfalse
effectTypefade
Card
defaulttrue
id1
labelStep 1


 

  • Go to: Control panel/WCM/ProviderOauth

Figure 2 - Fluig administrative panel

 

 



 
Card
id2
labelStep 2


  • Click Add and fill in the fields as shown:

    Figure 3 - Oauth provider registration 

    Details:

     

    Field
    Example
    Code01
    OAuth ProviderWCM
    DescriptionExample application
    Access token URL

    http://<ServerFluig>/portal/api/rest/oauth/access_token


    Request token URL

    http://<ServerFluig>/portal/api/rest/oauth/request_token 


    User authorization URL http://<ServerFluig>/portal/api/rest/oauth/authorize
    Request methodGET
    Signature methodHMAC-SHA1

 



Card
id3
labelStep 3


 

  • Go back to the control panel and go to: Control panel/WCM/Oauth app

    Click Add and fill in the fields as shown:


Figure 4 – Oauth application registration 

Details:

Fields
Example
 Consumer key

<your application public key>

OAuth Provider

Provider registered in step 2

Consumer secret<your application secret key>


Card
id4
labelStep 4


 

  • Optional: If your application performs actions on its behalf, you can create a user application. On the same application registration screen there is an "Application user" action: after accessing it, you will be able to generate tokens that are exclusive for the application. If your application's actions should be executed on behalf of a user, then the application must go through the standard OAuth authentication process.

Figure 5 - application user

Example application

There is an application developed by the Fluig team that shows how to use the API. The application is developed in Java. You have to have JDK 1.7 installed before running the application. Build and dependencies management is made by Maven, so it is mandatory to have it installed in the development environment to be used.

...

In FluigClientExample class, note that the execution will: list the users, create a post on the user's personal page, create a post in a community and list the posts of a community. During the execution, the call result logs will be displayed on the console.