<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00009RZrsfCADOkta Classic EngineAuthenticationAnswered2023-07-11T20:45:14.000Z2023-07-10T23:46:49.000Z2023-07-11T20:45:14.000Z
Okta Signin Widget: Config transformUsername not letting asynchronous fetch call to finish

Hello all, I've seen some suggested username transformation solutions that utilize fetch calls to other sources (haven't seen a complete working solution yet). However when attempting to use a fetch call, Okta will continue to sign the user in without waiting for fetch to finish and properly transform the username. Is there anything that I'm missing here? The data comes back properly, but it just doesn't come back in time even with await.

 

config.transformUsername = async function(username,operation) {

let url = 'someurl';

const res = await fetch(url);

const data = await res.json();

 

return data[username]

? data[username]

: username;

}


  • User16594883467582706479 (Customer Support Online Experience)

    Hi, @User16421791517005709055 (Customer)​ 

     

    Thank you for posting on our Community page!

     

    My advice would be to leverage the Okta Developer forums for this type of questions and take advantage of their expertise.

    https://devforum.okta.com/

     

    Thank you for reaching out to our Community and have a great day!

    _____________________________________________________________________________

    Community members help others by clicking Like or Select as Best on responses. Try it today.

    _____________________________________________________________________________

    Expand Post
This question is closed.
Loading
Okta Signin Widget: Config transformUsername not letting asynchronous fetch call to finish