Toggle menu

renderLoginForm

Creates a new AuthSession and returns the login form to the caller in the form of two variables: headerContent and bodyContent.

Header content is text for the site to output in the header, and body content is text to output in the page body where the login form to be situated.

If the 'siteuser' iCM maintenance area is online but is scheduled to go offline in the future then this method will return a user friendly message informing the user that site logins will be disabled from that time. This message is output by the loginform/body.hbs template.

If the 'siteuser' iCM maintenance area is offline this method will return a user friendly message informing the user that site logins are currently disabled. This message is output by the hbMaintenanceModeHeaderTemplate and hbMaintenanceModeBodyTemplate handlebar templates in the worker configuration.

Parameters

NameTypeDescription
returnUrlString (URL), requiredURL to return to after passing through the authentication system without an error

Will have the 'as' (AuthSessionId) and 'asn' (AuthSessionNonce) query parameters appended to it
errorReturnUrlString (URL), requiredURL to return to after an error within the authentication worker occurs

Will have the 'as' (AuthSessionId) and 'asn' (AuthSessionNonce) query parameters appended to it
baseAuthWorkerUrlString (URL), requiredPublicly accessible path to the Auth worker, eg http://mysite/apiserver/auth

Used internally to build URLs to other endpoints, eg baseAuthWorkerUrl + "/http/reentry"
fromEmailAddressObject, requiredA JSON object containing two non-null, non-empty string fields: "address" and "name"
siteCClampUrlString (URL), requiredThe site "C-Clamp" within which the various auth dialogues (for account linking etc) should be injected
zoneIdInteger, optionalThe ID of the zone requesting authentication. Either zoneId or subsiteId must be supplied
subsiteIdInteger, optionalIf the zoneId is not supplied the subsiteId is used to retrieve the zoneId from iCM
loginFormTypeString, optionalThe type of login form to render, either Standard or formembedded. Default: Standard
hbsContextMap, optionalA map that can be supplied in a RenderLoginForm call, the contents of which is made available to the handlebars templates that render the login form. Typically this could be used to output extra data supplied by the site templates to the login form templates. It is also used when rendering the login dialogue in formembedded mode to supply the name of the form being rendered, as this must be prefixed to the name of the button(s) output for each provider
providersArray<String>, optionalNames of the providers to return, eg ["icmsiteuser","facebook"]

If the name of a provider that is not available is sent, it will be ignored. If not supplied, all configured providers will be returned.
namedTemplateOverridesArray<String>, optionalAffects handlebars template resolution.
siteUserGroupIdsArray<Long>, optionalSite groups that the iCM Site User created/updated by the authentication process should be added to.
accountManagementBoolean, optionalSet true to enable management mode (for account linking etc)
managingUserIdInteger, optionalRequired to enter account management mode. The ID of the user to manage
asIdString, optionalSupply the current session ID when entering account management mode to prevent a new one form being generated

Response Fields

NameTypeDescription
headerContentString, requiredText for the caller to output in the page header.
bodyContentString, requiredText for the caller to output in the page body.

Example Request

{
    "id": 294,
    "jsonrpc": "2.0",
    "method": "renderLoginForm",
    "params": {
        "baseAuthWorkerUrl": "http://demodev1.gossinteractive.com/apiserver/auth/",
        "errorReturnUrl": "http://demodev1.gossinteractive.com/testauthworker.cfm",
        "returnUrl": "http://demodev1.gossinteractive.com/testauthworker.cfm",
        "fromEmailAddress": "login@website.com",
        "siteCClampUrl": "https://mywebsite/page",
        "subsiteId": 1,
        "fromEmailAddress": {
            "address": "support@gossinteractive.com",
            "name": "Tim"
        }
    }
}

Example Response

{
    "id": 294,
    "jsonrpc": "2.0",
    "result": {
        "result": {
            "headerContent": "[...SNIP_HTML...]",
            "bodyContent": "[...SNIP_HTML...]"
        }
    }
}

Last modified on June 27, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon