> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# InterSystems IRIS for Health SMART on FHIR connector profile – StackOne setup guide

> Set up a connector profile using SMART on FHIR for InterSystems IRIS for Health in StackOne to allow users to link their accounts.

> [!WARNING]
>
> Requires administrator access to the InterSystems IRIS Management Portal, or to the admin console of the external authorization server your FHIR server trusts.

## Register a SMART app

These steps use the OAuth 2.0 server built into IRIS. On an external authorization server, create a confidential client with the same redirect URL, grant type, authentication type and scopes.

**1. Check the authorization server**

Sign in to your IRIS Management Portal and open **System Administration** > **Security** > **OAuth 2.0** > **Server**.

<ul>
  <li>**Supported grant types (check at least one)**: **Authorization code** selected</li>
  <li>**Return refresh token**: **If offline\_access scope requested**</li>
  <li>Click **Save**.</li>
  <li>The **Authorization URL** and **Token URL** stay empty when the **Issuer endpoint** has the same host as your FHIR server. Otherwise, add `/oauth2/authorize` and `/oauth2/token` to the **Issuer endpoint**, or use the endpoints of your external authorization server, and copy them into your Connector Profile.</li>
  <li>Format: `{Issuer endpoint}/oauth2/authorize` and `{Issuer endpoint}/oauth2/token`</li>
  <li>Example: if the **Issuer endpoint** is `https://auth.example.org`, your **Authorization URL** is `https://auth.example.org/oauth2/authorize` and your **Token URL** is `https://auth.example.org/oauth2/token`</li>
</ul>

![The OAuth 2.0 Authorization Server Configuration page with the Issuer endpoint and the Authorization code grant type highlighted](https://mintcdn.com/stackone-60/I9nTEOTYDON35hNB/connectors/intersystemsfhir/images/smart_user-setup-authorization-server.png?fit=max\&auto=format\&n=I9nTEOTYDON35hNB\&q=85\&s=685309e2ef9a0d41a9eea12bce39d8a1)

**2. Add the scopes**

On the **Scopes** tab, check that `openid`, `fhirUser`, `offline_access`, `user/*.rs` and `user/*.cud` are listed. Patient sign-in also uses `launch/patient` and `patient/*.rs`. Add the ones the list is missing.

<ul>
  <li>Click **Add Supported Scope**.</li>
  <li>**Enter supported scope**: the scope, such as `offline_access`</li>
  <li>Click **OK**.</li>
  <li>Click **Save**.</li>
</ul>

![The Scopes tab with the SMART on FHIR scopes and the Add Supported Scope button highlighted](https://mintcdn.com/stackone-60/I9nTEOTYDON35hNB/connectors/intersystemsfhir/images/smart_user-setup-scopes.png?fit=max\&auto=format\&n=I9nTEOTYDON35hNB\&q=85\&s=5a80d86d43639f06d99bfc158d626ab0)

**3. Create the client**

On the server configuration page, open **Client Descriptions**.

<ul>
  <li>Click **Create Client Description**.</li>
  <li>**Name**: `StackOne`</li>
  <li>**Client type**: **Confidential**</li>
  <li>Click **Add URL**.</li>
  <li>**Enter URL**: the **Callback URL** from your Connector Profile</li>
  <li>Click **OK**.</li>
</ul>

![The Client Description form with Name, Confidential, Redirect URLs, Authorization code and form encoded body highlighted](https://mintcdn.com/stackone-60/I9nTEOTYDON35hNB/connectors/intersystemsfhir/images/smart_user-setup-client-description.png?fit=max\&auto=format\&n=I9nTEOTYDON35hNB\&q=85\&s=5abf8db96c2eba795eb6d1310b13b5da)

**4. Set the grant and authentication types**

These settings on the same form decide how the client gets its tokens.

<ul>
  <li>**Supported grant types (check at least one)**: **Authorization code**</li>
  <li>**Authentication type**: **form encoded body**</li>
  <li>Click **Save**.</li>
</ul>

**5. Copy the client credentials**

In the **OAuth 2.0 Server** list, click the new client's name.

<ul>
  <li>Open the **Client Credentials** tab.</li>
  <li>Copy the **Client ID** into your Connector Profile.</li>
  <li>Click **show** next to **Client secret**.</li>
  <li>Copy the **Client secret** into your Connector Profile.</li>
</ul>

![The Client Credentials tab with the Client ID field and the show link highlighted](https://mintcdn.com/stackone-60/I9nTEOTYDON35hNB/connectors/intersystemsfhir/images/smart_user-setup-client-credentials.png?fit=max\&auto=format\&n=I9nTEOTYDON35hNB\&q=85\&s=bcc16f286f290e8d6dfc47f4953426eb)

## Find your FHIR R4 base URL

IRIS accepts tokens only over https, for the exact FHIR address the token was issued for. Set it once in your Connector Profile and it applies to everyone who connects.

**1. Copy the endpoint from FHIR Server Management**

Sign in to your IRIS Management Portal and open **Health** > your FHIR namespace > **FHIR Server Management**. The server card shows the endpoint path after **URL:**.

<ul>
  <li>Format: `https://{IRIS web server host}{URL path}`</li>
  <li>Example: if you reach IRIS at `https://iris.example.org` and the card shows `URL: /csp/healthshare/fhirserver/fhir/r4`, your **FHIR R4 Base URL** is `https://iris.example.org/csp/healthshare/fhirserver/fhir/r4`</li>
  <li>Check it against the `implementation.url` value at `{FHIR R4 Base URL}/metadata`, and use that value exactly, including any port it shows.</li>
</ul>

![The FHIR Server Management page with the server card's URL highlighted](https://mintcdn.com/stackone-60/I9nTEOTYDON35hNB/connectors/intersystemsfhir/images/smart_user-config-fhir-server-url.png?fit=max\&auto=format\&n=I9nTEOTYDON35hNB\&q=85\&s=7ee01a2da6fb8cfffebe1ee490e6d4d4)

## Create the StackOne Connector Profile

**1. Create a Connector Profile**

Enable the connector and create a Connector Profile in your project. See [Setup Connector Profile](https://docs.stackone.com/gateway/quickstart.md#setup-connector-profile).

**2. Link an Account**

Once the Connector Profile is created, continue to [link an account](https://docs.stackone.com/connectors/intersystemsfhir/guides/link-account/smart-on-fhir.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.