Okta: How to create usernames without email address?

Viewed 2947

How can I create unique usernames, without email address?

When I send curl request as below

curl -X POST \
  'https://xxxx.oktapreview.com/api/v1/users?activate=true' \
  -H 'accept: application/json' \
  -H 'authorization: SSWS xxxx' \
  -H 'content-type: application/json' \
  -d '{
  "profile": {
    "firstName": "Isaac",
    "lastName": "Brock",
    "email": "isaac@test.com",
    "login": "isaac1223"
  },
  "credentials": {
    "password" : { "value": "ddas4235sff" }
  }
}'

I get response as below

{
  "errorCode": "E0000001",
  "errorSummary": "Api validation failed: login",
  "errorLink": "E0000001",
  "errorId": "oaeVuAktJ_ZSbGQbB_VfsuFlg",
  "errorCauses": [
    {
      "errorSummary": "login: User name must be in the form of an 
email address (e.g. bob@nowhere.com)"
    }
  ]
}

I want to keep different username than email address, how to achieve this in okta?

2 Answers

This is actually possible through their Profile Editor.

Go to your admin dashboard, then hit Directory > Profile Editor

Once there, you can edit the "user" profile by clicking on the edit action next to it. This will allow you to add custom attributes for users, remove attributes, or edit existing attributes. You can edit by clicking the icon in the attribute row.

To remove the email format constraint from username, you can click that icon in the username row, go to Format Restrictions and choose "None". This should allow you to format your usernames however you wish!

Another option is to choose the Custom Character Restriction which will allow you to set more granular restrictions.

Source: I am an admin on an Okta instance

Related