Back to top
Vastuu Group

Register an application

Last updated: Feb. 6, 2020
|
Reading time: 4 min

Application is simply an identity in Platform of Trust. However, an application has a special purpose for developers. It is required to start building your own applications on top of Platform of Trust.

Explore and consume data products

You need to implement Platform of Trust OAuth flow for your users. This guide is meant for developers who have already created an account in Platform of Trust and are familiar with basic concepts such as Bearer token and identities and links.

Create a group identity

Before you can create an application, you should make sure you are a part of a Group. It can be either an organization you are working for or just a group of developers you are developing with. Group is an identity in Platform of Trust, and you must be linked to it with MemberOf type of link.

If you don't belong to any Group, you can use world-sandbox.oftrust.net to create your group identity. There in UI you can create Identity with a Group type. You will get your Group's ID which you will use while creating an application.

Group "FooBar" was created. Use this id to create application: 7a5c0197-7e05-4180-8d6f-104911880eee

This means that now you belong to FooBar group.

How to register an application

You can either use Application API or world-sandbox.oftrust.net. To learn more about Application API, visit the API profile page in the Developer Portal.

Remember that your application will be just like any other Identity. So you might want to provide a description and other information. Some of that information will be shown to users during Authorization flow or later when exploring their network of Identities

NOTE: The `clientSecrets` is shown only once in plain text, when creating the application. Make sure you save it somewhere. The client secret is used for validating the application.

Application API

In order to create an application, you can send a request to Application API:

curl --request POST \
  --url https://api-sandbox.oftrust.net/apps/v1 \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf' \
  --header 'Content-type: application/json' \
  --data '{
    "name": "Example Application",
    "description": "Application description",
    "privacyPolicyUrl": "http://example.com/privacy.html",
    "webPageUrl": "http://example.com/application.html",
    "iconUrl": "http://example.com/icon.png",
    "scopes": "",
    "defaultScopes": "",
    "redirectUris": "https://example.com/auth-callback",
    "defaultRedirectUri": "https://example.com/auth-callback",
    "groupId": "7a5c0197-7e05-4180-8d6f-104911880eee"
  }'

Response: Ok
Status: 200 OK
Body:

{
  "@context": "https://standards.lifeengine.io/v1/Context/Identity/Digital/Software/App/",
  "@type": "App",
  "@id": "8c40d6d4-2dbb-4f8f-987f-5c68e7475d79",
  "data": {
    "iconUrl": "http://example.com/icon.png",
    "privacyPolicyUrl": "http://example.com/privacy.html",
    "description": "Application description",
    "webPageUrl": "http://example.com/application.html",
    "name": "Example Application"
  },
  "metadata": {
    "createdAt": "2020-02-14T07:18:22+00:00",
    "createdBy": "e224629d-3f4f-4cb2-8823-fdc839e5da98",
    "updatedAt": "2020-02-14T07:18:22+00:00",
    "updatedBy": "e224629d-3f4f-4cb2-8823-fdc839e5da98"
  },
  "inLinks": [],
  "outLinks": [],
  "client": {
    "clientId": "8c40d6d4-2dbb-4f8f-987f-5c68e7475d79",
    "redirectUris": "https://example.com/auth-callback",
    "defaultRedirectUri": "https://example.com/auth-callback",
    "scopes": "",
    "defaultScopes": "",
    "clientSecrets": [
      "4RbY09PR16F74VacbFhIsxzAJTytJfplpgZRdqE_tp4"
    ]
  },
  "tokens": [
    {
      "access_token": "wvkBrsvjBEigwd-PA...1h5vweXnzCEvpkapESHz6sxE",
      "expires_in": 63072000,
      "token_type": "Bearer"
    },
    {
      "access_token": "CkT5COQfHtbuih1a2...1h5vweXnzCEvpkapESHz6sxE",
      "expires_in": 63072000,
      "token_type": "Bearer"
    }
  ]
}

Read more about /products/v1 request in Product API documentation. To learn more about Product API, visit the API profile in the Developer Portal.

You can read more at Application API docs.

Web

You can also register your application via web UI. Go to world-sandbox.oftrust.net and log in. Find "Applications" menu option in top left side of a screen. Follow UI to create your application:

Register applicaation via My World UI

As a result, you should get:

Application registration completion in MyWorld

Summary

Creating an application is an easy, but important step for developers. Once you have created an application, you are able to get the maximum value out of Platform of Trust APIs. E.g. you can start working with Data Broker and create Data Products. You can also start integrating OAuth flow to your application. This will allow your users to access the Platform of Trust APIs.

Read more about how to integrating Platform of Trust OAuth flow to access APIs guide to access Platform of Trust APIs.

For detailed documentations on Platform of Trust core APIs, Visit Platform of Trust API Documentation.

Ready to explore more?

Try Platform Sandbox

Improvement Suggestions? or a New Guide?

Tell us in GitHub