Azure B2C - Layout Customization - - azure

I am trying figure out how Azure B2C layouts are working. I have my custom layout that is based on below code:
<!DOCTYPE html>
<html>
<head>
<title>My Product Brand Name</title>
</head>
<body>
<div id="api"></div>
</body>
</html>
How to customize that "Welcomes, Sign in with your email address? For example how to change that to the social_intro? How to change sentence to simple another :) ?
sign in prnt scrn

you can download the translation files from the portal UI.
Home > Azure AD B2C | User Flows > (your flow) > Languages
Then you can click a Language (English for instance) and then under Page-level resource files, choose a page and then "Download defaults (en)". The file is a JSON file that you can edit.
{
"ElementType": "UxElement",
"ElementId": null,
"StringId": "local_intro_generic",
- "Override": false,
- "Value": "Sign in with your {0}"
+ "Override": true,
+ "Value": "Your custom intro"
}
Save the file and then upload it on the same panel where you downloaded it from.

In order to customize the “Welcomes, Sign in with your email address”. You can go through the following steps: You need to login Azure portal>Azure AD B2C> Go to your tenant:
Image 1
 Then Select the policies on left side and under policies select “User Flow”: 
Image 2 
In User flow, select the policy which needs to be changed like this: 
Image 3
 Then click on “Download” 
Image 4 
Now open the downloaded file. You can search for the text that you want to modify and replace it with the desired text.
You can save the file and then upload it to your tenant. You will be able to see the changes.

Related

Trying to limit the country list in multifactor authentication page in Azure ADB2C User Flow

I have tried to limit the country list in authentication page by overriding the default json file in language customization like below. But that is not reflecting in the page.
"LocalizedStrings": [
{
"ElementType": "UxElement",
"ElementId": null,
"StringId": "countryList",
"Override": true,
"Value": "{\"IN\":\"India\"}"
}
]
I found that I was doing changes in wrong page (i.e, multifactor authentication page). These are the steps
Click Your User Flow
Languages -> Click 'Enable Language Customization' in the menu if it's not enabled
Select the language
Click phone signin page in flyout menu and download the defaults json
Then add this
"LocalizedCollections": [
{
"ElementType": "ClaimType",
"ElementId": "countryCode",
"TargetCollection": "Restriction",
"Override": true,
"Items": [
{
"Name": "India(+91)",
"Value": "IN"
}
]
}
]
Upload this json.
Have a look at this post.
Here's an example:
<LocalizedString ElementType="UxElement" StringId="countryList">{"DEFAULT":"Country/Region","AU":"Australia","NZ":"New Zealand"}</LocalizedString>
You can customize the country list by downloading the strings for the Multifactor Authentication Page by going to your B2C resource in the Azure Portal and navigating to:
Your policy (assuming this is a SUSI policy)
Customize -> Languages
Click 'Enable Language Customization' in the menu if it's not enabled
Select the language you want to customize ('EN' in my case)
In the flyout menu, find the "Multifactor authentication page" section under "Page level resource files", and expand this section
Click "download defaults (en)"
Open the downloaded JSON file in your editor
Edit the JSON by removing/modifying entries to the StringId countryList which is of ElementType UxElement. Make sure you also set the Override value to true. My example is:
{
"LocalizedStrings": [
{
"ElementType": "UxElement",
"ElementId": null,
"StringId": "countryList",
"Override": true,
"Value": "{\"IN\":\"India\"}"
}
]
}
Save the file and upload as an override by using the file selector control.
You may have to refresh your browser, but you should see the changes take.
The other issue is that you're uploading an override for the wrong page template. The one I used for a screenshot was "Multifactor phone authentication" for a SUSI User Flow. The page template looks to be phonefactor.

How do I customize button and link labels in Azure B2C login page?

Using Azure AD B2C, I want to change the signup link text that says "Sign up now" to say "Create an account". How do I do this?
Just in case any body need to change the text on singing signup page using custom policies, you also can use the Localization customization to add the text that you need for specific language.
Those are the instructions
https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-localization
Are you using User flows or Custom Policies (Identity Experience Framework)?
If you are using the user flow, go to Azure Portal and select user flow you like to customize. You will see the languages tab on lower left. Click on it then choose the language, for example English. Next download the JSON file for page level resource.
Now, download the JSON file:
Change the value inside the JSON:
{
"ElementType": "UxElement",
"ElementId": null,
"StringId": "createaccount_link",
"Override": false,
"Value": "Sign up now"
},
To:
{
"ElementType": "UxElement",
"ElementId": null,
"StringId": "createaccount_link",
"Override": false,
"Value": "Create an account"
},
Finally, upload the file back and you should now have updated text for the link.
Few Corrections on the answer shared by #Razi
Download the Json file from Unified Sign up or sign in page instead of Local Account Sign Up Page.
Make Sure to Modify the Override value to true so that B2C will able to detect the change, if there is no true value in the Override you will see below error while uploading the file.
Few Inputs from my side
User flows supports 2 options now as per below Screenshot:
If you have selected Recommended Version use the below Json:
{
"ElementType": "UxElement",
"ElementId": null,
"StringId": "createaccount_one_link",
"Override": true,
"Value": "Create an account"
}
For the Standard Version #Razi already answered above.

Azure AD B2C translation of custom HTML elements

I'm using Azure AD B2C custom UI and I'm wondering if it is possible to use the translation of own HTML elements
Here is an example:
<hr />
<h3 class="text-center" id="Custom1SignUpNewAccountMessage>Sign up with a new account</h3>
<div id="api" data-name="SelfAsserted">
</div>
I can see the text "Sign up with a new account". Now I would like to translate it for different languages because at the moment it is fixed.
I used the JSON from DefaultLocalizedResources.
"LocalizedStrings": [
{
"ElementType": "UxElement",
"ElementId": null,
"StringId": "Custom1SignUpNewAccountMessage",
"Override": true,
"Value": "Hier neuen Acount registrieren!!!"
},
Unfortunately, Custom1SignUpNewAccountMessage is not a valid element.
Is it possible to do translation "outside" <div id="api" ...>?
The B2C multi-language string overrides are only for the translation of strings that are rendered by B2C. That's the feature's primary purpose because otherwise there is no easy way for developers to translate these strings as they do not have direct control over them.
B2C does not provide a framework for translation of strings not rendered by it. That will need to be handled by the application, and typically there are existing developer frameworks that can be used by developers depending on the platform of their choice.

web notification on azure blob static website

I have a static website using azure storage:
https://helloweb.blob.core.windows.net/content/index.html
What is the domain I need to configure at onesiganl app settings:
Site URL : https://helloweb.blob.core.windows.net
Default Notification Icon URL: https://helloweb.blob.core.windows.net/content/icon.png
My manifest.json:
{
"name": "Hello Web",
"short_name": "Helloweb",
"start_url": "/content/index.html",
"display": "standalone",
"gcm_sender_id": "482941778795"
}
I can't see any user at onesignal users page.
According to onesignal document mentioned that OneSignalSDKWorker.js & OneSignalSDKUpdaterWorker.js should be served from the top-level root.
In the Azure storage, we are not able to set the blob in the top-level root. The blobs require a container.
Upload the files to the top-level root of your site directory. The following URLs should be publicly accessible:
• https://yoursite.com/manifest.json
• https://yoursite.com/OneSignalSDKWorker.js
• https://yoursite.com/OneSignalSDKUpdaterWorker.js
OneSignalSDKWorker.js & OneSignalSDKUpdaterWorker.js
• These files should not be renamed and the files should be served from the top-level root
From my experience ,it is not a good choice that put the website in the Azure storage. We could use azure WebApp service to do that easily. I do a test for it. It works correctly.
The following is my detail steps:
1.Create WebApp from the Azure portal
2.Configure OnSignal settings
3.Download the Web Push SDK and follow the tutorials to edit the manifest file.
4.Add an index file and just need to replace the "YOUR APP ID"
<head>
<link rel="manifest" href="/manifest.json">
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async></script>
<script>
var OneSignal = window.OneSignal || [];
OneSignal.push(["init", {
appId: "YOUR_APP_ID",
autoRegister: false,
notifyButton: {
enable: true /* Set to false to hide */
}
}]);
</script>
</head>
5.Upload the code into WebApp using Kudu (https://yoursite.scm.azurewebsite.net/).We can drag files into the folder directly. More deploy please refer to official document.
From the Firefox browser visit https://yoursite.azurewebsite.net/index.html. And we need to set permission to set the message popup.
Check from [All User] we will see the subscribed user info

Prompt for Access Code each time a recipient access document

Our DocuSign users are accessing documents by clicking on a link in an email. We are specifying an Access Code on each recipient. But we want to prompt access code each time when recipient open document. There is settings available for the same but we do not want to change that account settings manually to login in to DocuSign web console. But we want to manage this settings from DocuSign REST API. Is there any REST API available to so we can manage below account settings.
Login to the DocuSign web console (as an Administrator).
Navigate to Preferences >> Features.
In the Drop-down List labeled Authenticate on return access to
envelope, select the value "Each Access".
Click the Save button
I just found API is available to update this settings. Here are the details.
PUT /v2/accounts/{accountId}/settings
Set value of parameter "authenticationCheck" to "each_access" or "initial_access" as below.
{
"accountSettings": [
{
"name": "authenticationCheck",
"value": "each_access"
}
]
}
OR
{
"accountSettings": [
{
"name": "authenticationCheck",
"value": "initial_access"
}
]
}

Resources