<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
0D50Z00008G7VPQSA3Okta Classic EngineSingle Sign-OnAnswered2022-11-01T21:13:04.000Z2017-04-09T20:42:52.000Z2018-08-12T04:16:51.000Z
Custom exppression
Hi Experts,

 

For ServiceNow SSO integration, we have selected "AD SAM account name" as the application username format for login to ServiceNow application. But we do have some external customers who is not present in AD but present in Okta, and we would like to use Employee Number for them to login insted of samAccountName.

 

So i need to create a custom expression such a way that if user does not have a "AD SAM account name" the it should use employeenumber for authentication.

 

But i could not even try to pull the user samAccountName using custom attribute

 

For eg:- when i try to preview this exppression, i get error message as "Property user.samAccountName not found"

${user.samAccountName}

 


  • The custom option in the dropdown for App Username on the Sign On tab of an application only allows for customization of the 4 main attributes: first name, last name, email, and Okta username.  I would recommend setting the app username using Universal Directory using an expression like: user.sAMAccountName != null ? user.sAMAccountName : user.employeeNumber
    Expand Post
    Selected as Best
  • The custom option in the dropdown for App Username on the Sign On tab of an application only allows for customization of the 4 main attributes: first name, last name, email, and Okta username.  I would recommend setting the app username using Universal Directory using an expression like: user.sAMAccountName != null ? user.sAMAccountName : user.employeeNumber
    Selected as Best
  • NidhinC.60762 (Customer)

    Thanks Patrick! I just used below custom expression in Profile editor.

    hasDirectoryUser()?findDirectoryUser().samAccountName:user.employeeNumber

     

This question is closed.
Loading
Custom exppression