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

    Importing user through generic connector

    Scheduled Pinned Locked Moved
    Q&A
    2
    7
    954
    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.
    • H
      harish_reddy
      last edited by

      Hi

      I have a fusionauth tenant with a generic connector configured. In certain cases, I would like to import the user into Fusionauth but prevent the login.

      My API endpoint is returning a user with fields
      user.active: false
      user.verified: false
      user.registrations[0].verified:false

      But the login request is going through and all those fields are set to true in fusionauth user store.

      Is this a bug or expected behaviour? I think it is very normal for a legacy system to contain users without a verified email.

      TIA

      1 Reply Last reply Reply Quote 0
      • danD
        dan
        last edited by

        Hiya,

        I think this thread is worth a read: https://fusionauth.io/community/forum/topic/5/can-you-limit-a-user-s-login-authentication-access-to-applications-within-a-single-tenant

        Basically, to prevent a login just check for a 202 status code, which indicates the user is authenticated (known by the system) but not authorized for the given application.

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

        1 Reply Last reply Reply Quote 0
        • H
          harish_reddy
          last edited by

          Thanks for the reply.

          I checked the thread.

          This is not issue with using login API. This is a webhook configured in generic connector to import users on validation of password through a API call.

          Is there a way for this API to respond to convey to fusionauth system that "import the user with supplied password, but fail this login request"

          danD 1 Reply Last reply Reply Quote 0
          • H
            harish_reddy
            last edited by

            On a different topic:

            I have applications created under a tenant other than default "Fusionauth"

            Created a user without any registrations to those applications.

            I expected the oAuth login to fail when user tries to login with any of these applications. But the login request happened successfully for this application.

            What is the use of having registrations to application, when the user is able to login through oauth client even without a registration ?

            Can some one please clarify.

            danD 1 Reply Last reply Reply Quote 0
            • danD
              dan @harish_reddy
              last edited by

              @harish_reddy said in Importing user through generic connector:

              Is there a way for this API to respond to convey to fusionauth system that "import the user with supplied password, but fail this login request"

              Ah, sorry, I misunderstood.

              I don't think there's a way to do this without writing some code. The connector stuff is still in technology preview, so feel free to file an issue in github with your use case: https://github.com/fusionauth/fusionauth-issues

              If I needed to accomplish this, I'd probably write a webhook that listened to the user.create event, check to see which connector had created the user, and then deactivate the account using the user API.

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

              1 Reply Last reply Reply Quote 1
              • danD
                dan @harish_reddy
                last edited by dan

                @harish_reddy said in Importing user through generic connector:

                What is the use of having registrations to application, when the user is able to login through oauth client even without a registration ?

                Ah, that is what https://fusionauth.io/community/forum/topic/5/can-you-limit-a-user-s-login-authentication-access-to-applications-within-a-single-tenant addresses specifically.

                A user account is for authentication. A user registration is for authorization.

                So someone can login to the application but they won't receive the applicationId in the JWT. Your application should check to see that a JWT has the correct applicationId before allowing a user to proceed further.

                Hope that helps!

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

                1 Reply Last reply Reply Quote 1
                • danD
                  dan
                  last edited by

                  Looks like this might be an issue you'd want to upvote: https://github.com/FusionAuth/fusionauth-issues/issues/439

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

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