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

    Duplicate email verification emails being sent, and forgot password 401

    Scheduled Pinned Locked Moved
    Q&A
    0
    5
    1.7k
    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.
    • B
      bmatthews
      last edited by bmatthews

      Hi all,

      I am having some odd issues with fusionauth and emails being sent. I am using a lot of the services headlessly and making calls to fusionauth server through the c# client package.

      I first noticed I was getting duplicate email verification emails sent. Every time I registered, I would always get two. I went to sendgrid and verified that it was indeed getting two api calls. I am calling it like such

      RegistrationRequest regReq = new RegistrationRequest();
                      UserRegistration userReg = new UserRegistration() { applicationId = new Guid(_authSettings.ApplicationId) };
                      User regUser = new User() { email = model.Email, password = model.Password, username = model.Email };
                      regReq.registration = userReg;
                      regReq.user = regUser;
      
                      FusionAuthClient client = new FusionAuthClient(_authSettings.ApiKey, _authSettings.Host, _authSettings.TenantId);
                      ClientResponse<RegistrationResponse> RegResp = await client.RegisterAsync(null, regReq);
      

      The response comes back as successful and the user is added correctly.

      I thought, perhaps, it may just be that one service call so I went to test it out with my other service endpoint that would send an email, forgotpassword. However, that is giving me a 401 response though I use it in the same fashion as register.

      FusionAuthClient client = new FusionAuthClient(_authSettings.ApiKey, _authSettings.Host, _authSettings.TenantId);
                      ForgotPasswordRequest forgotReq = new ForgotPasswordRequest();
                      forgotReq.applicationId = new Guid(_authSettings.ApplicationId);
                      forgotReq.email = model.Email;
                      forgotReq.username = model.Email;
      
                      ClientResponse<ForgotPasswordResponse> forgotResp = await client.ForgotPasswordAsync(forgotReq);
      

      This comes back with a 401 response, indicating the apikey is incorrect, however the same key is used in all other calls through the library and do not give 401.

      Anyone have any thoughts on either problem?

      Thanks in advance!

      B 1 Reply Last reply Reply Quote 0
      • B
        bmatthews @bmatthews
        last edited by

        I was actually able to figure out the duplicate email problem. Having a tenant part of an application, the tenant verification settings do not override the application verification settings. So if verification email was turned on in the application and the tenant, both entities will send out verification emails.

        Is this the intended behavior?

        The forgot password issue remains.

        1 Reply Last reply Reply Quote 1
        • B
          bmatthews
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • B
            bmatthews
            last edited by

            Dan was kind enough to point out that I did not check the apikey level permissions. All working now.

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

              Darn API key permissions!!

              shaking-fist.png

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

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