This method creates a new AuthSession and returns the details of it to the caller. It is designed to be used in place of renderLoginForm when, rather than a login form, the user is logging in via SSO and should be redirected to the SSO provider.
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
Parameters
| Name | Type | Description |
|---|---|---|
| returnUrl | String (URL), required | URL to return to after passing through the authentication system without an error |
| errorReturnUrl | String (URL), required | URL to return to after an error within the authentication worker occurs |
| baseAuthWorkerUrl | String (URL), required | Publicly accessible path to the Auth worker, eg http://mysite/apiserver/auth |
| fromEmailAddress | Object, required | A JSON object containing two non-null, non-empty string fields: "address" and "name" |
| siteCClampUrl | String (URL), optional | The site "C-Clamp" within which the various auth dialogues (for account linking etc) should be injected |
| zoneId | Integer, optional | The ID of the zone requesting authentication. Either zoneId or subsiteId must be supplied |
| subsiteId | Integer, optional | If the zoneId is not supplied the subsiteId is used to retrieve the zoneId from iCM |
| providers | Array<String>, optional | Names 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 |
| siteUserGroupIds | Array<Long>, optional | Site groups that the iCM Site User created/updated by the authentication process should be added to |
| accountManagement | Boolean, optional | Set true to enable management mode (for account linking etc) |
| managingUserId | Integer, optional | Required to enter account management mode. The ID of the user to manage |
| asId | String (UUID), optional | Supply the current session ID when entering account management mode to prevent a new one form being generated |
| verify | Boolean, optional | Default: false. Used with the GOV.UK One Login service (and the openid provider) to create a "verify" auth session. The verify process allows users to verify their identity with the provider without creating/updating a login or user account |
| verifyUserId | String | Required when "verify" is true. The user ID to match with the verified account user. If a 'verify' auth session has a 'verifyUserId' the account id of the verified user will get checked against the given 'verifyUserId' |
Response Fields
| Name | Type | Description |
|---|---|---|
| as | String | The AuthSession's authSessionId |
| asn | String | The AuthSession's nonce value |
| maintenanceMode | Boolean | Whether or not the worker is in maintenance mode |
| providers | Array <string> | The configured providers |
Example Request
{
"id": 294,
"jsonrpc": "2.0",
"method": "createLoginSession",
"params": {
"baseAuthWorkerUrl": "http://test.com/apiserver/auth/",
"errorReturnUrl": "http://test.com/testauthworker",
"returnUrl": "http://test.com/testauthworker",
"fromEmailAddress": {
"address": "[email protected]",
"name": "Tim"
},
"zoneId": 1
}
}
Example Response
{
"jsonrpc": "2.0",
"id": 76,
"result": {
"as": "2f725fe2-0b6a-4dc4-982a-25cbe5191269",
"maintenanceMode": false,
"asn": "a792b656-4de1-4bf2-a0db-5d2ce1e6d847",
"providers": ["icmsiteuser"]
}
}
