How to handle the link between an external Identit...
# support
t
Hello, I've managed to setup a configuration using the Keycloak Identity Provider with Medplum on my local machine. I have a question though, in order for me to successfully login I had to have : - One user created in my Identity Provider - One user created in Medplum with the same email address. My question is what would be the best flow of handling user creation and with which tools ? Should we use bots to create users ? Should we use a middleware ? The application that we are creating is patient and practionner facing. Thank you very much.
Following this question, another one raised as I have just digged the login process. Here's my setup : http://localhost:8103 : medplum API http://localhost:3000 : medplum backoffice http://localhost:8080 : keycloak http://localhost:5175 : MyApp I manage to login correctly with my user on the Keycloak interface and here I have two different processes : - If the user only has one ProjectMembership associated, then after the login process between Keycloak and Medplum API using this flow https://www.medplum.com/docs/auth/methods/external-identity-providers, I am correctly redirected to http://localhost:5175 (MyApp) and I can indeed verify that the user is logged in - If the user has multiple ProjectMembership associated, after the login flow I get redirected to http://localhost:3000 (appBaseUrl) to choose the profil I want to get logged in with, after choosing the profile I still get redirected to localhost:3000 and I am logged in the medplum application. My expectation was that : - either before choosing the profile I get redirected to "MyApp" and the choice of the profile is then done by "MyApp" - either after choosing the profile I get redirected to "MyApp" with the correct profile informations. Thank you very much for your answer !
r
Have you set up the redirect URIs on the Client Application and specified the Client Application in the signin form? https://www.medplum.com/docs/auth/methods/oauth-auth-code#create-a-client-application
t
Hello @reshma , I think I have, see the screens attached.
VITE_MEDPLUM_CLIENT_ID= "237a9885-4a03-47f2-9520-47e9390beb71" #Found in the ClientApplication in the Medplum server (Look for ClientApplications in the Resource Searcher and get the ID)
VITE_MEDPLUM_CLIENT_ID= "237a9885-4a03-47f2-9520-47e9390beb71" #Found in the ClientApplication in the Medplum server (Look for ClientApplications in the Resource Searcher and get the ID)
And again, if my User doesn't have multiple ProjectMembership associated, it works correctly.
r
Got it. Ok - pls make sure the Signin form also includes the ProjectId - here's an example https://github.com/medplum/foomedical/blob/main/src/pages/SignInPage.tsx
r
@thomabig - I just wanted to check in on this issue and see if you were able to make progress
186 Views