FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    API to search for users by username?

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    2
    2
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      theogravity-sb
      last edited by

      I'm performing an import from Cognito and we have usernames that are completely unique on it. The import API for FusionAuth will error out if there is a duplicate user being inserted.

      I'm trying to write something that will filter out users already imported into FusionAuth from Cognito, but the User search API using elasticsearch (I'm on hosted FA) doesn't always return results when I search by username using queryString.

      Is there a better way to go about searching for users against a username?

      danD 1 Reply Last reply Reply Quote 0
      • danD
        dan @theogravity-sb
        last edited by dan

        @theogravity-sb

        Hiya,

        You should be able to specify the property to search when using the queryString.

        • username:test will exactly match users with that username

        • username:tes* will match any users that have a username that starts with tes.

        Does that help?

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post