This is a follow up question to an earlier post titled “Okta User Self-Registration Question”.
I was able to figure out how to populate a user attribute dropdown field by adding code to the “parseSchema” function of the Registration section of the OktaSignIn widget. I am now able to dynamically populate the field by making a REST/AJAX call to my backend server.
I have just one issue. I need to make the field wider to display more of the selection options. Is there
a way via the OKTA organization platform to configure the width of a particular User Registration attribute?
Typically if you want to add a list for self service registration you would create a new attribute in your Okta user schema as a String attribute that enumerates allowed values and is read/write.
This will make it show up in the registration form with all the drop down options. If you need to further modify the list for some reason, change language if the browser is set to another language then you could do that with parseSchema().
Thank you Erik for the detailed explanation. Also is there an option to render a checkbox field in the widget. Below code renders a select list instead of checkbox.
parseSchema: function (schema, onSuccess) {
schema.profileSchema.properties.age18Consent = {
'type': 'boolean',
'title': 'Im over the age of 18'
};
},
Hi Erik, can I ask you about parseSchema() function? Is it added to configuration object? Can I use it with Okta hosted sign-in page? I’ve tried something like this but cannot get it working:
config.registration = {
parseSchema: (schema, onSuccess) => {
// handle parseSchema callback
onSuccess(schema);
}
};