loading
Preparing LoginRadius developer resources
Mission: Help enterprises accelerate digital transformation with our fully-managed Customer IAM technology.
Skip to main content

Workflow Page Setup

LoginRadius Auth Studio lets you build branded authentication experiences using Templates and Styles. This page covers how to configure a Workflow Page: the Auth Studio page type that renders IO workflow UI at runtime.
Editor

Templates and Styles

Templates define the overall page structure (HTML, BeforeJS, CustomCSS, CustomJS). Each template can have multiple Styles: a Style keeps the same HTML but applies different CSS, letting you support multiple visual themes from one template.

To create a template:

  1. In the Admin Console, go to Auth Studio.
  2. Click Add New Template.
  3. Choose to start from scratch, use a pre-built template, or create with AI.
  4. Name the template and open it in the editor.

To manage styles:

  • Open a template and navigate to the Styles tab.
  • Create a new style, clone an existing one, or set a default style.
  • Styles control the login box, page background, buttons, inputs, and other visual elements.
  • Pass the style name as the s query parameter in the authorize URL to activate it at runtime.

Workflow Page Customization

The Workflow Page is the page type used for IO workflow rendering. It requires a <div id="workflow-container"></div>: this element is mandatory and is replaced at runtime with the workflow UI generated by the IO engine.

You can customize the Workflow Page across four layers:

LayerWhat it controls
HTMLPage layout and structure. The workflow-container div must be present.
BeforeJSJavaScript that runs before the workflow loads. Used to initialize the SDK, parse query parameters, and configure the workflow.
CustomCSSStyles applied on top of the template CSS. Use CSS variables for consistent branding.
CustomJSJavaScript for interactivity or third-party integrations after the workflow loads.

Minimal HTML example:

<div style="background-color: var(--page-background); text-align: var(--sdk-text-align);">
<h3 style="color: var(--sdk-card-text-color);">Complete Your Setup</h3>
<div id="workflow-container"></div> <!-- mandatory -->
</div>
caution

The <div id="workflow-container"></div> element is mandatory. If it is missing, the workflow UI will not render and users will see a blank page.


Default BeforeJS Script

The BeforeJS script initializes the LoginRadius SDK, reads query parameters from the authorize URL, and wires up success and error handlers. The default script below works for all standard IO workflow pages:

var LRObject = new LoginRadiusSDK(commonoptions);
var lr_raas_settings = window.lr_raas_settings || {};
lr_raas_settings.workflow = lr_raas_settings.workflow || {};

let rawQueryString = LRObject.util.parseQueryString(
window.location.search.replace("?", "")
);
let queryString = {};
for (let key in rawQueryString) {
queryString[key.toLowerCase()] = rawQueryString[key];
}

lr_raas_settings.workflow = {};
lr_raas_settings.workflow.clientId = queryString.client_id;
lr_raas_settings.workflow.workflowName = queryString.workflowname;
lr_raas_settings.workflow.debugMode = queryString.debugmode;
lr_raas_settings.workflow.state = queryString.state;
window.lr_raas_settings = lr_raas_settings;

lr_raas_settings.workflow.container = "workflow-container";

lr_raas_settings.workflow.onSuccess = function (response, flag) {
if (response.access_token) {
redirectToReturnUrl(response.access_token);
}
};

lr_raas_settings.workflow.onError = function (errors) {
if (errors) console.log(errors.error, true);
};

LRObject.init("workflow", lr_raas_settings.workflow);

function redirectToReturnUrl(token) {
let queryString = LRObject.util.parseQueryString(
window.location.search.replace("?", "")
);
if (queryString.return_url) {
window.location =
queryString.return_url.indexOf("?") > -1
? queryString.return_url + "&token=" + token
: queryString.return_url + "?token=" + token;
} else {
window.location = "profile.aspx";
}
}

The script reads client_id, workflowname, debugmode, and state from the query string. On success it redirects to return_url with the access token appended; on error it logs to the console. Customize onSuccess and onError to match your application's post-auth logic.


Key Design Decisions

USE CSS VARIABLES FOR BRANDING
Auth Studio exposes a set of CSS custom properties that are shared across all page types. Using them keeps your Workflow Page visually consistent with your login and registration pages without duplicating values.
--sdk-card-bg-colorCard / form container background
--sdk-card-text-colorPrimary text inside cards
--page-backgroundFull-page background color
--sdk-text-alignText alignment across all SDK elements
CLONE STYLES BEFORE TESTING CHANGES
The default style for a template is what live users see. Editing it directly affects production immediately. Clone the style, make your changes, test them using the style preview and the s query parameter, then promote the clone to default when satisfied.
LIMIT HEAVY CUSTOMJS
CustomJS runs after the workflow is initialized. Heavy scripts, large libraries, or blocking calls in CustomJS delay the time-to-interactive for the workflow form. Keep CustomJS focused on lightweight event handlers and defer any analytics or third-party loading asynchronously.