Do we have to use Medplum App if we choose "Medplu...
# support
s
I'd like to self-host Medplum. - I have Medplum Server running at http://localhost:8103/ and Medplum App running at http://localhost:3000/. - In the Medplum App, I created a client. Its Redirect URI is http://localhost:8000/ - I'm trying to set up "Medplum as IDP" as instructed at https://www.medplum.com/docs/auth#browser-based-authentication - I'm trying to run the oauth demo: https://github.com/medplum/medplum-oauth-demo. I changed: -
const baseUrl = 'http://localhost:8103/';
-
const clientId = '....' (to the client ID displayed in the Medplum App)
-
const redirectUri = 'http://localhost:8000/';
- Then I run the demo at http://localhost:8000/ So when I click the "login" button on the oauth demo page, it redirects me to http://localhost:3000 (Medplum App) and prompts me to login Question: Can we do this: "on our own app page, we let user input email and password, then send them to Medplum Server for authentication, then the Server redirects back to our own app page"? (so we can do auth without running Medplum App)
r
Nope - you can use another ClientApplication on your own application. Here's how you configure the ClientApplication https://www.medplum.com/docs/auth/medplum-as-idp#create-a-client-application
s
Hey reshma, thanks for your reply - I'm still trying to figure out, why did the page redirect to localhost:3000 when I clicked the "login" button? I didn't have "localhost:3000" in any config.
m
Hi @starved ! I believe you're using the
/oauth2/authorize
endpoint, correct? That endpoint will automatically redirect to whatever the
appBaseUrl
parameter is in server, which is probably
localhost:3000
. I think you might want to use the
/auth/login
in your case. Is that what your
appBaseUrl
is set to?
s
45 Views