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

    Invalid redirect

    Scheduled Pinned Locked Moved
    General Discussion
    2
    4
    4.0k
    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.
    • R
      richb201
      last edited by richb201

      It has been a year since I first complained about getting this error. I am wondering if there have been any revelations since that time? I have switched over from using my laptop with ngrok to using EC2. I am getting the same exact error (from the same code). Just as a reminder, I am sending the passwordless email to a user. When they click on it they get this popup from fusionAuth.

      {
      "error" : "invalid_request",
      "error_description" : "Invalid redirect uri https://researchstudyonline.com:81/index.php/Configure/report_generator_amazing",
      "error_reason" : "invalid_redirect_uri"
      }

      Is there anyway to see what is causing this error?

      1 Reply Last reply Reply Quote 0
      • R
        richb201
        last edited by richb201

        And here is the code that causes that:

                $request["applicationId"] = $_SESSION['applicationID_login'];
        
                $request["loginId"] = $email;
                $request["state"]["redirect_uri"] = "http://researchstudyonline.com:81/index.php/Configure/report_generator_amazing";
                // $request["state"]["client_id"] = $_SESSION['applicationID_admin_register_login'];
                $request["state"]["client_id"] = $_SESSION['applicationID_login'];
                $request["state"]["response_type"] = "code";
                $request["state"]["scope"] = "openid";
                $request["state"]["state"] = "$email";
                $requestJ = json_encode($request);   //convert the array into json
                $result = $_SESSION['client']->withTenantId($_SESSION['tenantID_login'])->startPasswordlesslogin($requestJ);
                if (!$result->wasSuccessful()) {
                    log_message('error', $result);
                }
        
                $code = $result->successResponse->code;
                //send the email
                $request = array();
                $request["code"] = $code;
                $request["X-FusionAuth-TenantId"]=$_SESSION['tenantID_login'];
                $request["user"]["data"]["admin_email"] = $email;
                $requestJ = json_encode($request);   //convert the array into json
                $result = $_SESSION['client']->sendPasswordlessCode($requestJ);
                if (!$result->wasSuccessful()) {
                    log_message('error', $result);
                }
        

        Are there any error messages in a log?

        1 Reply Last reply Reply Quote 0
        • R
          richb201
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • N
            Nushkha
            last edited by

            The issue with the redirect URI specified in your code. FusionAuth is indicating that the redirect URI you provided is invalid.
            The redirect URI must match the one registered for your FusionAuth application.

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