# eRx IDP Quick Tips

If your organization uses identity provider (IDP) single sign-on with DrFirst Rcopia, this page covers common configuration tips and troubleshooting steps.

## What is IDP-based access?

Instead of requiring prescribers to maintain a separate DrFirst username and password, IDP integration allows Welkin to pass a trusted authentication token to Rcopia. The prescriber logs into Welkin once, and Rcopia accepts that authenticated session without a second login prompt.

This is the recommended approach for organizations already using SSO (e.g., Google Workspace, Okta, OneLogin, Azure AD).

## Setting up IDP for eRx

1. Confirm with your Welkin CSM that IDP-based eRx is enabled for your environment
2. Provide your IdP metadata URL or SAML assertion details to your Welkin implementation team
3. Welkin and DrFirst will configure the trust relationship between your IdP and Rcopia
4. Test with a sandbox prescriber account before going live

## Common issues and fixes

### Prescriber sees a DrFirst login screen instead of auto-launching

**Cause:** The IDP token is not being passed correctly, or the prescriber's Welkin user account is not linked to their DrFirst NPI.

**Fix:** Verify the prescriber's NPI is entered in their Welkin user profile under **Integrations → DrFirst eRx**. Confirm the Rcopia username in the user profile matches exactly what DrFirst has on record (case-sensitive).

### Authentication error after login

**Cause:** The SAML assertion may be missing required attributes (NPI, name, or organization ID).

**Fix:** Review the attribute mapping in your IdP configuration. Required attributes are `npi`, `firstName`, `lastName`, and `organizationId`. Contact your Welkin implementation team to review the token payload.

### Session timeout during prescribing

**Cause:** The Rcopia session token has a shorter timeout than the Welkin session.

**Fix:** Configure session timeout in the DrFirst Admin console to match your Welkin session length. Alternatively, enable **Auto re-authenticate** in the eRx panel settings in Designer.

### Rcopia loads but patient is not pre-populated

**Cause:** Patient context is not being passed in the IDP token.

**Fix:** Ensure **Auto-load patient** is enabled in the Rcopia component settings in Designer. Confirm the patient's date of birth and name fields are populated in Welkin (required for patient matching).

## Testing IDP authentication

Use the DrFirst sandbox environment to test before going live:

1. Log in as a configured prescriber in the Welkin Care portal (staging/UAT environment)
2. Open a test patient record
3. Click the eRx panel – it should launch Rcopia without prompting for credentials
4. Verify the patient name and DOB are pre-populated in Rcopia

If issues persist, collect the browser console errors and share them with your Welkin support contact.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.welkinhealth.com/integrations/drfirst-erx/erx-idp-quick-tips.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
