Skip to main content

Add Machine to Machine (M2M) OAuth client application

Add a machine-to-machine OAuth client application for calling APIs.

  1. Select your Workspace, depening on your use case:

    • To call Admin level APIs, select the Admin workspace.

    • To call Root or System APIs, select the System workspace.

    • To call APIs protected by an Authorizer, create the client in the same workspace where the APIs and authorizer are connected.

    Admin and System Workspace Access

    If you need to access the Admin or System workspace, contact Support.

  2. In your workspace, select Applications > Clients > Create client.

  3. Provide a name for your application, selet the Service type, and click Create.

    Create application
  4. Copy or download the client application configuration (client ID and secret) and add it to your backend application code.

    Copy credentials
  5. Copy the token endpoint and add it to your backend application.

    You can use any OAuth library library for your application.

    Copy token endpoint
  6. Use the client credentials flow to call the token endpoint.

    Example CURL with the client_secret_post client authentication method:

    curl -X POST https://$TENANT_ID.$REGION_ID.authz.cloudentity.io/$TENANT_ID/$WORKSPACE_ID/oauth2/token \
    --header "Content-Type: application/x-www-form-urlencoded" \
    --data-raw "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET"

Next Steps