Skip to content

Allow for modifying the OAuth authUrl or request parameters to add additional parameters to support SMART-on-FHIR launch flow #1116

@almostchristian

Description

@almostchristian

SMART on FHIR requires adding a launch parameter when requesting a code for the launch flow. This may not be used by the auth server itself, but rather by a proxy. In my case, I have a proxy that sits between rapidoc and Keycloak, the proxy will read and store the launch parameter and then redirects to the real keycloak authorizationUrl without the launch parameter. After the user logs in to Keycloak, it then redirects to the proxy with the code response. The proxy processes the keycloak response, then the proxy redirects the code and other parameters back to rapidoc.

Currently, rapidoc has no mechanism to customize the authCodeParams. I can try adding the parameter in the authorizationUrl but then it will have to be hardcoded to the OpenAPI document.

const authCodeParams = new URLSearchParams(authUrlObj.search);
const selectedScopes = checkedScopeEls.map((v) => v.value).join(' ');
if (selectedScopes) {
authCodeParams.set('scope', selectedScopes);
}
authCodeParams.set('client_id', clientId);
authCodeParams.set('redirect_uri', redirectUrlObj.toString());
authCodeParams.set('response_type', responseType);
authCodeParams.set('state', state);
authCodeParams.set('nonce', nonce);
if (pkceCheckboxEl && pkceCheckboxEl.checked) {
authCodeParams.set('code_challenge', codeChallenge);
authCodeParams.set('code_challenge_method', 'S256');
}
authCodeParams.set('show_dialog', true);
authUrlObj.search = authCodeParams.toString();

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions