Skip to content

Access ​

Orisha Commerce Platform uses Auth0 for authentication (verifying user and machine identities). Authorization (determining permissions) is managed within the Orisha Commerce Platform itself.

The following sections outline the steps to gain access to each application.

Admin portal ​

  1. Create a user in Auth0

    • Log in to the Auth0 management portal for the orisha-commerce-platform tenant.
    • Navigate to the User Management module and create a new user.
  2. Assign a role

    • Locate the newly created user and assign the Orisha Commerce Platform Admin access role.
    • This grants the user permission to log into the Admin portal.
  3. The user can now access the Admin portal

App ​

  1. Create a user in Auth0

    • Log in to the Auth0 management portal for the orisha-commerce-platform tenant.
    • Navigate to the User Management module and create a new user.
    • Copy and store the user_id for later use (it typically starts with auth0|...).
  2. Assign a role

    • Locate the newly created user and assign the Orisha Commerce Platform App access role.
    • This allows the user to log into the App.
  3. Create a new identity in the Admin portal

    • Log into the Admin portal.
    • Navigate to the Identities module and create a new user identity.
    • Use the copied user_id from Auth0 as the identifier.
    • Assign the appropriate administrations to the identity.
  4. The user can now access the App

API ​

Setup ​

  1. Create a new application in Auth0

    • Log in to the Auth0 management portal for the orisha-commerce-platform tenant.
    • Navigate to the Applications module and create a new application.
    • Copy and store the Client ID for later use.
  2. Authorize the API

    • Locate the newly created application and authorize Orisha Commerce Platform API under the APIs tab.
  3. Create a new identity in the Admin portal

    • Log into the Admin portal.
    • Navigate to the Identities module and create a new application identity.
    • Use the copied Client ID from Auth0 as the identifier, appending @clients to it.
      • Example: If the Client ID is 3KqAm3tLnJeiK94MMlqAar, the identifier should be 3KqAm3tLnJeiK94MMlqAar@clients.
    • Assign the appropriate administrations to the identity.
  4. The machine can now generate access tokens

Generate access token and perform requests ​

Before generating access tokens, ensure that Auth0 is properly configured to issue them.

  1. Retrieve the Client ID and Secret

    • Log in to the Auth0 management portal for the orisha-commerce-platform tenant.
    • Navigate to the correct application under the Applications module.
    • Copy and store the Client ID and Client Secret for later use.
  2. Generate an access token

    Perform a client credentials exchange to obtain an access token:

    sh
    curl --request POST \
         --url https://auth.core-suite.io/oauth/token \
         --header 'content-type: application/json' \
         --data '{
             "client_id": "[CLIENT_ID]",
             "client_secret": "[SECRET]",
             "audience": "https://ocp-publicapi.core-suite.io/",
             "grant_type": "client_credentials"
         }'

    Response:

    json
    {
      "access_token": "...",
      "token_type": "Bearer"
    }
  3. Perform API requests

    Use the access token to make authorized requests to the API:

    sh
    curl --request POST \
         --url https://publicapi-ocp-acc.core-suite.io/alpha/auth/me \
         --header 'authorization: Bearer [ACCESS_TOKEN]'

    Response:

    json
    {
      "identifier": "....@clients",
      "name": "Orisha Commerce Platform - Customer XYZ",
      "type": "Application",
      "administrations": [
        {
          "code": "customer-xyz",
          "name": "Customer XYZ"
        }
      ]
    }