REFRACT Platform Connector for Power Platform

Connector Setup & Configuration

IT admin guide for the REFRACT Platform Power Platform connector. Covers App Registration setup, connection parameter reference, and environment management.

Architecture

The REFRACT Platform Connector uses a single-tenant, service-to-service architecture. Each organization's Power Platform environment connects directly to its own Dispatcher - there is no shared Refract Logic infrastructure in the data path.

Power Automate Flow
      │
      ▼
REFRACT Platform Connector (Power Platform)
      │  reads 5 connection parameters (Dispatcher URL, Tenant ID,
      │  Client ID, Client Secret, Scope)
      │  connector script acquires a token via
      │  grant_type=client_credentials, then forwards the request
      ▼
Customer-hosted REFRACT Dispatcher (Azure Function App)
      │  validates JWT claims (iss, aud, tid)
      ▼
REFRACT Platform Services
  ├── PDF Generation
  ├── e-Signature Processing
  ├── Approval Workflows
  ├── Audit & Compliance
  └── Document Storage (Blob / SharePoint)

Data sovereignty: OAuth tokens are issued by the customer's own Microsoft Entra ID tenant, using an App Registration the customer's IT admin controls. Documents are generated and stored within the customer's Azure subscription; when a flow triggers REFRACT eSign or REFRACT Workflow, every document download redirects the browser to the customer's own Dispatcher, which streams the bytes directly - the REFRACT-hosted portal never receives them.

No on-premises data gateway involved

This connector does not use, and does not require, Microsoft's On-Premises Data Gateway product. "Gateway" here refers only to the Dispatcher's own /gateway/v1/* route layer - a set of Azure Function routes that accept an OAuth bearer token. There is no gateway to install, and no separate registration of the connector or the App Registration with the Dispatcher; the Dispatcher accepts any bearer token whose iss, aud, and tid claims match its configuration, from wherever the request originates.


Prerequisites

Before creating a connection:

  1. REFRACT Platform Dispatcher deployed and running in the customer's Azure subscription
  2. Microsoft Entra ID App Registration for the connector to authenticate with, using client credentials (see below)
  3. Power Platform environment with System Administrator or Environment Maker permissions

Step 1: Create the App Registration

The connector authenticates to the Dispatcher using OAuth 2.0 client credentials (an app-to-app token, not a per-user sign-in). Each connection stores its own tenant ID, client ID, client secret, and scope, and the connector's own code (a custom connector script) exchanges these for a Bearer token on every call - there is no function key involved.

One connector app for Power Platform

Create an app registration for the Power Platform connector alone. Do not reuse another system's connector app, REFRACT SharePoint Access, or "REFRACT Dispatcher API" itself: a separate connector lets you revoke Power Platform's secret without affecting other systems, and its sign-ins are logged under its own name. The Dispatcher keeps no list of apps. It checks that the token was issued by your tenant for "REFRACT Dispatcher API" (see JWT Validation below), and that the calling app holds the Render.Access application permission. See Connect a source system.

Open Azure Portal

Go to portal.azure.com → Microsoft Entra ID → App registrations → New registration.

Register the Application

FieldValue
NameREFRACT Platform Power Platform Connector
Supported account typesAccounts in this organizational directory only
Redirect URILeave blank - a client-credentials app registration does not need one

Click Register.

Note the IDs

From the Overview page, copy:

  • Application (client) ID → entered as the connection's Client ID field
  • Directory (tenant) ID → entered as the connection's Azure AD Tenant ID field

Create a Client Secret

Go to Certificates & secrets → Client secrets → New client secret.

Set an expiry (recommended: 12 - 24 months). Copy the Value immediately - it is only shown once. This value is entered as the connection's Client Secret field.

Grant Render.Access and Lifecycle.Reader

Under API permissions, remove the Microsoft Graph User.Read permission a new registration lists. Then select Add a permission -> APIs my organization uses -> REFRACT Dispatcher API -> Application permissions, select Render.Access (required for every action) and Lifecycle.Reader (Get Document URL, Check Workflow Status, and Download Sealed PDF), and select Grant admin consent. Admin consent approves every permission on the list, so check it first. An Application Administrator or Cloud Application Administrator can grant it. Without Render.Access, every action fails with 403 and code ROLE_MISSING.

The connection's OAuth Scope is api://<dispatcher-app-client-id>/.default, where <dispatcher-app-client-id> is the client ID of "REFRACT Dispatcher API" (App registrations -> REFRACT Dispatcher API -> Overview), not this connector's client ID.


Step 2: Create a Connection

Once the connector is deployed, it appears in the Power Automate custom connectors list and flow makers can create connections.

REFRACT Platform connector in the Power Automate custom connectors list

Flow makers (or the IT admin, on their behalf) create connections by entering five values. There is no sign-in step.

Open Power Automate

Go to make.powerautomate.com → Data → Connections → + New connection.

Find and Select REFRACT Platform

Search for REFRACT Platform. Select the connector.

Enter the Connection Fields

Connect to REFRACT Platform dialog showing the Dispatcher URL, Tenant ID, Client ID, Client Secret and Scope fields
ParameterDescriptionExample
Dispatcher URLDispatcher Function App base URL - no /api suffixhttps://func-dispatcher-contoso-prod.azurewebsites.net
Azure AD Tenant IDOrganization's Microsoft Entra ID tenant GUIDc49962a1-53d3-4af8-8d5d-35f34cd0be9c
Client IDApplication (client) ID of the App Registration from Step 1(from Azure Portal)
Client SecretThat App Registration's client secret value(shown once at creation)
OAuth ScopeScope for the Dispatcher's App Registrationapi://<dispatcher-app-client-id>/.default

Dispatcher URL must not include /api

Enter https://func-dispatcher-contoso-prod.azurewebsites.net - the connector appends /api/ to all request paths automatically. If you include /api in the URL the requests will fail with 404.

Create the Connection

Click Create. There is no sign-in window - this connector uses client credentials, so the connection is saved immediately with the five values above. The connector does not define a connection test, so a wrong value only surfaces as an authentication error on the first flow run that uses this connection.


Connection Parameter Reference

ParameterTypeRequiredNotes
hostUrlstringYesDispatcher Function App base URL. No trailing slash. No /api suffix.
tenantIdstringYesMicrosoft Entra ID tenant GUID. Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
clientIdstringYesApplication (client) ID of the App Registration created for this connector.
clientSecretsecurestringYesThat App Registration's client secret value. Stored encrypted; never displayed again after saving.
scopestringYesOAuth scope requested for the client-credentials token, format api://<dispatcher-app-client-id>/.default.

These five values are stored per connection - there is no connector-level OAuth configuration shared across connections. Each connection can use a different App Registration if needed.

No function key

The Dispatcher's gateway routes do not use a function key. Authentication is entirely the client-credentials token the connector's own script acquires from the five connection values above.


Authentication Model

The REFRACT Platform Connector uses OAuth 2.0 client credentials - an app-to-app token, not an interactive user sign-in.

On every action call, the connector's own script (script.csx) reads the connection's tenant ID, client ID, client secret, and scope (injected as request headers by the connection's policy templates, then stripped before forwarding), posts a grant_type=client_credentials request to https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token, and attaches the resulting access token as a Bearer header on the forwarded request to the Dispatcher.

The client secret is stored encrypted as part of the connection. It is used only to acquire tokens from Azure AD - it is never forwarded to the Dispatcher and never visible again after the connection is saved.

JWT Validation

Before processing any request, the Dispatcher validates:

  • Issuer (iss) - Token must be issued by the authorised Microsoft Entra ID tenant.
  • Audience (aud) - Token must be intended for the Dispatcher's application registration. Both a bare client-ID audience and an api://-prefixed audience are accepted and compared as equal.
  • Tenant ID (tid) - Token must belong to the tenant configured in the Dispatcher's AZURE_TENANT_ID setting.

All three validations must succeed. Tokens issued for another tenant or another application are rejected before request processing begins. There is no IP allowlist and no gateway-registration check - a token that passes these three checks must also hold the Render.Access application permission, or it is refused with 403 and code ROLE_MISSING. Nothing checks where the request originates.

Tenant Isolation

A token that passes issuer and audience validation but contains a different tenant ID is rejected.

This prevents cross-tenant access and ensures only identities from the authorised Microsoft Entra tenant can invoke the customer-hosted Dispatcher.

Execution Model

Every action call runs through the connector's script.csx: it reads the credential headers, requests a token from Azure AD, attaches it as a Bearer header, and forwards the request to the Dispatcher.

Power Platform's custom-code connectors (the script.csx mechanism) carry a platform-level 5-second CPU budget, but time spent waiting on network calls - the Azure AD token request and the Dispatcher's own processing - does not count against it.

In practice, the effective limit is the Power Automate action timeout (typically 120 seconds). Document generation time varies with template complexity and payload size.

Customer-Hosted Processing

The connector never processes document content.

Document rendering, storage, and audit processing occur within the customer-hosted Dispatcher environment. When a request triggers REFRACT eSign, REFRACT Delivery, or REFRACT Workflow, every document download redirects the browser to the customer-hosted Dispatcher or SharePoint site, which serves the bytes directly; the REFRACT-hosted portal never receives them. The connector acts solely as an authenticated gateway between Power Platform and the Dispatcher API.


Dispatcher Environment Variables

The Dispatcher Function App must have these environment variables configured:

VariableDescriptionExample
JWT_REQUIREDEnforces JWT on all gateway routes. Fail-closed by default: enforcement is enabled unless this is set to the literal string "false". Leave unset (or "true") in production.(leave unset, or true)
JWT_ISSUERMicrosoft Entra ID token issuer URLhttps://login.microsoftonline.com/{tenantId}/v2.0
JWT_AUDIENCEExpected aud claim: the client ID of "REFRACT Dispatcher API", which infra/deploy.ps1 sets. Never a connector app's client ID. Tokens with or without the api:// prefix are accepted.<dispatcher-app-client-id>
AZURE_TENANT_IDAuthorised tenant GUID - checked against token tid claimc49962a1-...
JWT_JWKS_URIOptional - auto-derived from JWT_ISSUER if not set(leave blank)

Do not set JWT_REQUIRED to false in production

JWT enforcement fails closed by default - it is already enabled unless JWT_REQUIRED is explicitly set to the literal string "false". That opt-out exists only for local development (func start). Never set it in a production Dispatcher.


Multiple Environments

Create a separate connection for each environment (dev, test, prod). Each environment's Dispatcher has its own "REFRACT Dispatcher API" app registration, so the connection's Dispatcher URL and OAuth Scope both differ per environment. One connector app can hold permissions on several of them, but a connector app per environment keeps production credentials out of test flows.

EnvironmentDispatcher URLConnection Name
Developmenthttps://func-dispatcher-contoso-dev.azurewebsites.netREFRACT Platform - Dev
Testhttps://func-dispatcher-contoso-test.azurewebsites.netREFRACT Platform - Test
Productionhttps://func-dispatcher-contoso-prod.azurewebsites.netREFRACT Platform - Prod

Deployment Checklist

Before going to production:

  • App Registration created and client secret noted
  • The connection's OAuth Scope is api://<dispatcher-app-client-id>/.default, using the client ID of "REFRACT Dispatcher API" (the Dispatcher's JWT_AUDIENCE already holds that ID; it needs no change for a new connector)
  • Dispatcher env vars set: JWT_ISSUER, JWT_AUDIENCE, AZURE_TENANT_ID (JWT_REQUIRED left unset or "true")
  • Connection created with all five values (Dispatcher URL, Tenant ID, Client ID, Client Secret, Scope) - there is no connection test, so verify by running a flow
  • The connector's App Registration holds the Render.Access application permission, admin-consented (required for every action)
  • If flows use Get Document URL, Check Workflow Status, or Download Sealed PDF: the connector's App Registration has the Lifecycle.Reader application permission, admin-consented (see Integrations that use app tokens)
  • Generate Document action tested end-to-end with a real template and payload
  • Error handling implemented in flows (Configure run after → failed)
  • Client secret expiry date calendared for renewal

Troubleshooting

These errors come from the connector's own script.csx, before the request ever reaches the Dispatcher:

ErrorCauseFix
Connection parameter 'tenantId' is missing. Edit the connection and provide a value. (or clientId/clientSecret/scope)That field was left blank when the connection was createdEdit the connection and fill in the missing value
Invalid Client ID or Client Secret. Check your connection settings.Azure AD returned invalid_clientVerify the Client ID and Client Secret against the App Registration's Overview and Certificates & secrets
App not authorised for client_credentials. Check App Registration API permissions.Azure AD returned unauthorized_clientGrant and admin-consent the required API permission on the App Registration
Invalid OAuth Scope. Expected format: api://<app-id>/.default.Azure AD returned invalid_scopeCorrect the Scope field to api://<dispatcher-app-client-id>/.default
Azure AD rejected the token request (invalid_request): ...Azure AD returned invalid_request - usually a malformed Tenant ID, Client ID, Secret, or ScopeRe-enter the four values carefully, with no extra whitespace
Azure AD tenant not found. Check the Tenant ID value.Azure AD returned tenant_not_foundVerify the tenant ID in Azure Portal → Microsoft Entra ID → Overview
Authentication timed out. Check that the Tenant ID is correct and Azure AD is reachable.The token request to login.microsoftonline.com did not completeConfirm outbound connectivity from Power Platform to Microsoft Entra ID

These errors come from the Dispatcher itself, once a valid token reaches it:

ErrorCauseFix
503 with code TENANT_SCOPE_NOT_CONFIGUREDAZURE_TENANT_ID not set on the DispatcherSet AZURE_TENANT_ID in the Dispatcher Function App's environment variables
503 with code LICENSE_UNAVAILABLE on Generate DocumentThe Dispatcher could not reach the licensing service, and has no grace periodThe flow may send the request again after Retry-After. If it keeps happening, check that the Dispatcher can reach the licensing service
404 (empty body, x-ms-function-status: OK)Dispatcher URL includes /apiRemove /api from the Dispatcher URL in the connection
401 from DispatcherToken signature, issuer, audience, or expiry check failedConfirm the OAuth Scope names "REFRACT Dispatcher API" (api://<dispatcher-app-client-id>/.default, not the connector's own client ID), and that the tenant ID is the Dispatcher's tenant
403 from DispatcherToken's tid claim is missing or does not matchConfirm AZURE_TENANT_ID on the Dispatcher matches the tenant configured on the connection
403 with code ROLE_MISSING and "role": "Render.Access" on any actionThe connector's app does not hold Render.AccessGrant Render.Access to the connector's App Registration as an application permission and grant admin consent. See Integrations that use app tokens
403 with code ROLE_MISSING and "role": "Lifecycle.Reader" on Get Document URL, Check Workflow Status, or Download Sealed PDFThe connector's app does not hold the Lifecycle.Reader roleGrant Lifecycle.Reader to the connector's App Registration as an application permission and grant admin consent. See Integrations that use app tokens

Every other code the Dispatcher can return, and when a flow may send a request again, is on Error responses and codes.


Next Steps

On this page