Hi All, I am trying to figure out how to configure...
# ask-a-descoper
b
Hi All, I am trying to figure out how to configure a user name and password scenario for login. But any user that is invited seems to need an email or phone number. Can you point me to the right resource or help?
✅ 1
d
Username and Password Configuration You can configure username and password authentication without requiring email or phone numbers by using the Custom Login ID component in your flows. Setting Up Custom Login ID 1. In your flow, use the Custom Login ID component instead of Email or Phone components 2. Rename the component to "Username" in the designer 3. Connect it to your Sign Up/Sign In password actions
Copy code
<!-- The Custom Login ID component accepts any username format -->
<!-- No email/phone validation required -->
Key Benefits • Create any username without email/phone sanitization requirements • Support external IDs or custom identifiers • No email/phone requirement for password-based authentication The Custom Login ID field is specifically designed for usernames or external IDs that must be uniquely associated with a user . Whatever value users enter in this field becomes their unique identifier for sign up and sign in actions. Customize Password Authentication | Descope Documentation Login ID Fields in Flows | Descope Documentation Authentication Overview | Descope Documentation
b
yes but a tenant admin does not seem to be able to invite a user with just username and password
d
User Invitation Limitations You're correct - the current user invitation system requires email or phone numbers as login IDs. The Console and User Invite action expect these standard contact methods for sending invitations . Workaround Options 1. Create users directly via Management SDK instead of invitations:
Copy code
// Create user with username as login ID
const resp = await descopeClient.management.user.create(
  'username123', // loginId as username
  {
    displayName: 'User Name',
    // No email/phone required
  }
);
2. Use additional login IDs to include usernames alongside required email/phone :
Copy code
additionalLoginIds: ["username123"]
Current Limitation The invitation system requires email or phone for sending invitation messages . Even with Custom Login ID components in flows, the invitation process itself needs a communication channel (email/SMS) to deliver the invitation link. For pure username-only scenarios without any contact information, you'll need to create users directly through the Management SDK rather than using the invitation system. Customize User Invites | Descope Documentation Users in the Backend | Descope Documentation Using the User Invite Action | Descope Documentation
b
ok, but I don't see the username as an attribute in the user admin console. So how does one create/update the username for existing users?
d
Username Management for Existing Users Usernames are managed as additional login IDs rather than separate attributes. You won't see a dedicated "username" field in the console because usernames are stored as part of the user's login ID collection. Adding Usernames via Management API Use the Update User API with
additionalIdentifiers
to add usernames :
Copy code
// Update existing user to add username
const resp = await descopeClient.management.user.update(
  'existing-user-id',
  {
    additionalIdentifiers: ['username123', 'another-username']
  }
);
Console Workaround In the Console user invite/creation, you can add usernames by selecting "Add as Login Id" when adding user attributes . This adds the username to the user's login ID collection. Via Flows Use Update User actions in flows with "Add to login IDs" enabled to associate usernames with existing users . The key concept is that usernames are treated as login IDs, not separate user attributes. Users can have multiple login IDs including emails, phones, and custom identifiers like usernames . Update User Status | API Reference | Descope Documentation Customize User Invites | Descope Documentation Link User Identities | Descope Documentation Login ID Fields in Flows | Descope Documentation
b
hmm but the login ids field is greyed out/disabled in the console.
d
Console Login ID Field Limitation You're correct - the Login IDs field is read-only in the Console user interface. This is by design for data integrity reasons. The Console displays existing login IDs but doesn't allow direct editing. Alternative Methods to Add Usernames 1. Management API/SDK - Use the Update User endpoint with
additionalIdentifiers
:
Copy code
await descopeClient.management.user.update(userId, {
  additionalIdentifiers: ['username123']
});
2. During User Creation - When creating users via API, include usernames in
additionalIdentifiers
3. User Invite Workaround - When inviting users, use "Add as Login Id" checkbox for custom fields Why It's Disabled The Console restricts direct login ID editing to prevent accidental changes that could lock users out. Login IDs are critical authentication identifiers, so modifications are intentionally limited to API/SDK operations where you have more control and can handle errors programmatically. For username management, you'll need to use the Management API rather than the Console interface. Update User Status | API Reference | Descope Documentation Get User's Login History | API Reference | Descope Documentation Customize User Invites | Descope Documentation
b
I need a bit of help, I setup the update via the flows and it's not working for me. Can someone help review what I have setup on my side please?
d
Hi, I'm Descope's AI assistant. I'd be happy to help review your flow setup for updating users with usernames. To provide the most accurate guidance, I need to understand what's happening. What I Need to Know 1. What did you expect to happen when the flow runs? 2. What actually happened - are you getting an error, or is it just not adding the username as a login ID? Common Flow Setup Issues • Missing "Add to login IDs" checkbox in the Update User action • Incorrect form field mapping between screen input and update action • User already exists with conflicting login IDs Once you share what you're seeing, I can help pinpoint the specific issue in your flow configuration.
b
An existing user has email and phone number as their login ids. I have setup a screen to conditionally show based on whether the form.externalId field is empty or not. However this screen does not show to the user when the sign-in.
d
Issue with Conditional Screen Not Showing The problem is likely that
form.externalId
is not populated during sign-in for existing users. The
form
context only contains data from screens that collect user input - it doesn't automatically contain user attributes. Use
user.customAttributes.externalId
Instead
For existing users, check their custom attributes using the
user
context :
Copy code
user.customAttributes.externalId
Correct Condition Setup 1. Set your condition to check:
user.customAttributes.externalId
2. Use operator: "Is Empty" or "Is Not Empty" 3. Connect the appropriate path to your username collection screen Alternative Approach If the user hasn't signed in yet, use
unauthUser.customAttributes.externalId
to check attributes before authentication completes . Key Point
form.externalId
only exists if a previous screen in the current flow collected that input. For existing user attributes, always use
user.customAttributes.<attribute-name>
or
unauthUser.customAttributes.<attribute-name>
. The screen should now appear when the user's externalId custom attribute is empty. Dynamic Keys &amp; Values | Descope Documentation
b
So I have to create a customer attribute call externald first right
d
Hi, I'm Descope's AI assistant. Yes, exactly. You need to create the custom attribute first before you can reference it in flows or conditions. Create Custom Attribute 1. Go to Users Attributes> in the Console 2. Click "Add Custom Attribute" 3. Set the key as
externalId
(or whatever name you prefer) 4. Choose the appropriate data type (likely "String") 5. Save the attribute Then Update Your Condition Once created, you can reference it in your flow condition as: •
user.customAttributes.externalId
(for authenticated users) •
unauthUser.customAttributes.externalId
(before authentication) Important Note Existing users won't have this attribute populated until you either: • Update them via Management API • They go through a flow that sets this value • You import/update users with this attribute The custom attribute must exist in your project schema before you can use it in conditions or store values in it.
b
When the user goes through the flow, the loginid or the user.externalId is not being populated