B2C Portals

B2C Portals, formerly named Anonymous Frontends, expose specific Digital Journeys to unauthenticated users. This allows you to provide access to specific user journeys (for instance getting a quote for a car insurance) without having to create a FintechOS Platform user account in advance.

NOTE  
Starting with release 24.0, the Anonymous Frontends (deprecated) have been simplified by creating unique temporary user accounts for each anonymous journey session instead of reusing the same account (the impersonated user) for all sessions. This eliminates the necessity of a reverse proxy and to manually override the default save mechanism, while bringing extra security and easiness in "upgrading" anonymous users that start a journey to regular user accounts in the same session.

Expose a Digital Journey to Anonymous Users

To expose a digital journey to anonymous users, in the Configuration Manager, at the kv/<environment name>/b2cportal/b2c path, edit the following key:

Key Value
Journeys
Copy
[
      {
        "Name": "JourneyTutorial",
        "UseHttpRedirect": true
        "AllowedHeaders": [ "header1", "header2" ], 
        "RedirectUriInitiate": "https://myServer.net/b2cportal/#/userjourney/myEntity/insert/form/myForm",
        "RedirectUriError": "https://myServer.net/platform/Content/expired.html"
        "RedirectUriResume": "https://myServer.net/b2cportal/#/entity/myEntity/edit/00000000-0000-0000-0000-000000000000/form/myForm/pageno/1"
        "AnonymousUserLifespanDays": 30
        "TemporaryUser": { 
          "BusinessUnit": "root"
          "SecurityRoles": [ "SecRoleTutorial"
        }
      }
    ]
 
Parameter Description
Name Name of the digital journey to be exposed anonymously.
TemporaryUser Configures the temporary user accounts created for each anonymous session.
  • SecurityRoles - Security roles assigned to the temporary anonymous users.
    IMPORTANT!  
    These security roles must be also set up on all the flows of the anonymous journey (see Define access to the flow).
    If regular authenticated users also need access to the journey, they too need to have these security roles assigned.
  • BusinessUnit - Business unit associated with the temporary anonymous users.
AllowedHeaders HTTP headers to be forwarded in responses to the Initiate an Anonymous User Journey and Resume an Anonymous User Journey requests.
AnonymousUserLifespanDays Lifespan in days of the anonymous user accounts. During this time, the anonymous user can resume an interrupted journey.
Default value: 30.
RedirectUriInitiate FintechOS Portal URI returned when requesting to Initiate an Anonymous User Journey. E.g.: An insert form.
RedirectUriResume FintechOS Portal URI returned when requesting to Resume an Anonymous User Journey. E.g.: An edit form.
NOTE  
If the path includes a record ID, you can use any valid guid, e.g.: 00000000-0000-0000-0000-000000000000.
RedirectUriError URI returned if a request to Resume an Anonymous User Journey cannot be fulfilled (the session expired).
UseHttpRedirect

Determines if the user agent receives a redirect link or the actual page content when requesting to initiate/resume an anonymous user journey.

  • true - Returns an HTTP status code 302 response with the corresponding RedirectUriInitiate, RedirectUriResume, or RedirectUriResume address in the Location header field.

  • false - Returns an HTTP status code 200 response with the content of the corresponding RedirectUriInitiate, RedirectUriResume, or RedirectUriResume page in the response body.

Activate B2C Portals

To activate B2C portals globally, in the Configuration Manager, at the kv/<environment name>/app-features/B2C path, set the feature-b2c-userjourneys key to 1 (setting the parameter to 0 deactivates the anonymous B2C portals).

Initiate an Anonymous User Journey

Request

To initiate an anonymous journey, call the b2cportal/platform/B2CAuth/InitiateJourney endpoint using the GET method. Use the journeyName parameter in the call's URL to specify the name of the anonymous digital journey. To localize the journey in a specific language use the culture parameter with the value at your choice. The default value is English. E.g.:

https//platform-url/b2cportal/platform/B2CAuth/InitiateJourney?journeyName=JourneyTutorial&culture=RO-ro

Response

Depending on the UseHttpRedirect parameter setting, the response will include either a redirect link or the actual content of the RedirectUriInitiate page.

The response will also contain a cookie with the temporary user account information. The user will have the business unit and the security roles specified in the journey configuration.

Resume an Anonymous User Journey

Request

To resume an anonymous journey, call the b2cportal/platform/B2CAuth/ResumeJourney endpoint using the GET method. Use the same journeyName parameter in the URL to specify the name of the journey, and the sessionId parameter to identify the session belonging to the temporary user:

https//platform-url/b2cportal/platform/B2CAuth/ResumeJourney?journeyName=JourneyTutorial&sessionId=C175BFE5-EAFD-422F-A57F-7D85E806C38B

HINT  
Use the server.B2C.sessionID Server SDK function to get the session ID of the anonymous journey.

Response

In case the UseHttpRedirect parameter value is set to false , and if the resume happens within the of days set in the AnonymousUserLifespanDays parameter, the user is redirected to the RedirectUriResume page.

If the anonymous journey activation timeframe has passed, and the UseHttpRedirect parameter value is set to true, the endpoint returns the user to the RedirectUriError page.

Initiate/Resume Anonymous User Journeys with Digital Journey APIs

If you wish to access anonymous user journeys via custom applications, web applications, front-ends, etc., use the dedicated initiate and resume digital journey APIs.

Resume External Journeys in an Anonymous B2C Environment

To allow the user to resume a pre-populated digital journey in an anonymous B2C environment:

  1. Create a new temporary identity and session on the same journey by using the server.B2C.createTemporaryIdentity server SDK method in an event triggered automation script.
  2. Transfer data ownership from the existing user to the temporary one by adding the following to the script:
Copy
update(entityName,recordId, {UserId:tempIdentity.temporaryUserID});
  1. Provide updated Resume an Anonymous User Journey with the new session ID to the user.
HINT  
Use the sendMail method to communicate the journey link to your customer.

Use Custom Parameters in Anonymous User Journeys

You can provide custom parameters in an initiate or resume journey request by appending their names and values at the end of the request (preceded by the & symbol). E.g.:

https//platform-url/b2cportal/platform/B2CAuth/InitiateJourney?journeyName=JourneyTutorial&culture=RO-ro&parameter1=value1&parameter2=value2

or

https//platform-url/b2cportal/platform/B2CAuth/ResumeJourney?journeyName=JourneyTutorial&sessionId=C175BFE5-EAFD-422F-A57F-7D85E806C38B&parameter1=value1&parameter2=value2

Retrieve Custom Parameters in Anonymous User Journeys

Use the searchParams property to retrieve custom parameters values in the journey's client side code.

If your portal is running in Single Page Application mode (EBS router) use the following model:

Copy
EbsRouter.getState().searchParams.parameterName
 

If your portal is using legacy URLs use the following model:

Copy
var urlobj = new window.URL(window.location.href)
urlobj.searchParams.get("parameterName")

Manage Style Sheets for Anonymous User Journeys

FintechOS Portal instances that run anonymous user journeys (B2C portals) have fewer default style sheets and don't use themes. Therefore, you may have to apply some of the portal specific styling at the digital journey level.

To manage the style sheets for digital journeys which are exposed to unauthenticated users, follow the basic procedure for managing your Style Sheets.

NOTE  
There are specific style particularities for anonymous user journeys, described in the table below.

The following CSS elements are available for B2C user journeys:

Parameter Default Value Observations
--defaultFontSize 14px  
--defaultTextColor #333  
--linkColor #337ab7  
--linkHoverColor #23527c  
--controlTextColor #333 The color of the text displayed in controls. E.g.: OptionSet control.
--controlIconColor #333  
--controlBorderColor #ddd  
--controlActiveBorderColor #337ab7  
--errorColor #d64031 The background color of error toast messages.
--infoColor #2980b9  
--warningColor #feb332  
--successColor #049F0C