Hi, When I run script oauth login page locally htt...
# general
y
Hi, When I run script oauth login page locally https://github.com/medplum/medplum-oauth-demo/blob/main/index.html and login using gmail account, I redirect to app.medplum.com and not to localhost:8000 as redirect url in index.html file, is it expected behavior?
r
Hi Yury! Just to clarify, are you saying that even after you complete the login with Google, you are just re-directed to the Meplum App for the rest of the session?
Or is the question "why am I being redirected to app.medplum.com" for the sign in process?
y
the first option
this page opens
r
Got it. And what is your project id - will help me debug
y
23418854-0a74-45af-bc73-b2b8f4358d07
r
Ok, thanks for your patience Yury, I see what's going on. The root of the issue is that you're registered in the system twice with the same email address (yury@codexhealth.com): once as a practitioner (when Yaxuan invited you to the project) and once as a patient (when you registered with FooMedical). This basically means that you have 2 different "profiles", and you could either be logging in as a Patient, or as a Practioner (e.g. a doctor or administrator). Right now, our sign-in form doesn't support this, but the we're working on a fix. Our recommendation right now would be to create a register patient with a slightly different email (e.g. yury+test1@codexhealth.com), and then try this demo with that patient (using the username+password flow) for now. This is what Yaxuan was doing
One other note - I noticed that the redirect URI you have registered in "app.medplum.com" is different that
localhost:8000
. Just make sure they both match, otherwise you will get a "redirectUri does not match" error. Check out this tutorial for more details (https://www.medplum.com/docs/tutorials/security/oauth-auth-code)
y
Thank you Rahul
179 Views