Invalid redirect: http://127.0.0.1:5000/oauth/callback (4,700)

i am new to zoom and i appreciate some help. i am building a web application on flask-python and one of the functionalities is to connect doctors to patients through a teleconsultation.
i am trying to get a token so i went over the Oauth process. the web app is under development so i did not publish it in Marketplace. i am getting invalid redirect url 4,700 for my local url.
this is my server side code:
@app.route(‘/oauth/callback’)
def oauth_callback():
received_state = request.args.get(‘state’)
if received_state !=STATE:
return “Invalid state parameter, possible CSRF attack.”
code = request.args.get(‘code’)
credentials = f"{CLIENT_ID}:{CLIENT_SECRET}"
base64_credentials = base64.b64encode(credentials.encode()).decode()

headers={
    'Authorization':base64_credentials,
    'Content-Type': 'application/x-www-form-urlencoded'
}
payload={
    'code':code,
    'grant_type':'authorization_code',
    'redirect_uri':REDIRECT_URI,

}
response = requests.post(TOKEN_URL,headers=headers,data=payload)
if response.status_code==200:
    access_token = response.json().get('access_token')
    return f"Access token received:{access_token}"
else:
    return f"Error:{response.status_code},{response.text}"

this is my url redirect : http://127.0.0.1:5000/oauth/callback

Hey @johny.achkar01 welcome to the Zoom dev platform!

Can you try a redirect URL over HTTPS? Something like ngrok should help make this easy to setup. Be sure to add this domain to your allow list in the app.

Thank you Michael for your feedback. i used ngrok as you suggested in your above feedback.
now i am getting a new error “Error:400,{“reason”:“Invalid client_id or client_secret”,“error”:“invalid_client”}
althought i checked my client id and client secret and they look ok.
appreciate any help:
this is my code:
REDIRECT_URI =“https://4f18-37-186-45-147.ngrok-free.app/oauth/callback
@app.route(‘/create_meeting’, methods=[‘GET’, ‘POST’])
def create_meeting():
topic = “Create Meeting”
patient_name = session.get(‘pt_name_booked’)
doctor_email = session.get(‘doc_email’)
slot_duration = session.get(‘slot_duration’)
start_time = session.get(‘start_time’)
current_timestamp = round(time.time())
iat = current_timestamp
exp = iat + (60 * 60 * 2)
authorization_url = f”{AUTHORIZE_URL}?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}"
print(authorization_url)
return f"Click here to authorize Zoom "

@app.route(‘/oauth/callback’)
def oauth_callback():
code = request.args.get(‘code’)
credentials = f"{CLIENT_ID}:{CLIENT_SECRET}"
base64_credentials = base64.b64encode(credentials.encode()).decode()

headers={
    'Authorization':base64_credentials,
    'Content-Type': 'application/x-www-form-urlencoded'
}
payload={
    'code':code,
    'grant_type':'authorization_code',
    'redirect_uri':REDIRECT_URI,

}
response = requests.post(TOKEN_URL,headers=headers,data=payload)
if response.status_code==200:
    access_token = response.json().get('access_token')
    return f"Access token received:{access_token}"
else:
    return f"Error:{response.status_code},{response.text}"

Hello, i am still getting this error : Error:400,{“reason”:“Invalid client_id or client_secret”,“error”:“invalid_client”} and not being able to solve it .
i appreciate any support.