Skip to content

fgalan/oauth2-example-orion-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oauth2-example-orion-client

Oauth2 authentication example for Orion Context Broker applications. The example shows how to send a 'version/' request, this is the relevant part in server.js file:

        var optionsget = {
            host : 'orion.lab.fi-ware.eu',
            port : 1026,
            path : '/version',
            method : 'GET',
            headers: {
                'X-Auth-Token': auth_token
            }
        };

However, you can adapt this example to send more interesting NGSI requests :)

Running it

  • Software requirements:

    • nodejs
    • npm
  • Install the dependencies:

    npm install

  • Configure OAuth2 credentials in config.js file (you will find theme in your IDM account)

  • Start example server

    sudo node server

  • Connect to http://localhost to try the example. You will see a text with the Orion Context Broker (running at orion.lab.fi-ware.eu:1026) version string

Quick way

You can also run the token_script.sh script (authored by Universidad Politecnica de Madrid team) in order to get a fresh X-Auth-Token. The program will ask you your FI-LAB user, password and organization ID.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.9%
  • Shell 3.1%