Login with Username and password

We are creating flutter app for patients and we have created Registration form for patients, now once Registration of patients, if they have to login with username and password, than which api we need to use ? there is no default openemr api for allowing login for patients with their username and password ?

The APIs do support logging in patients with their username / password.

Users would login using the OpenEMR’s OAuth2 Password Grant or Authorization Grant in the APIs. Note these kinds of login mechanisms are part of OAuth2. We add a client registration / api client pieces by coupling OAuth2 with Open ID Connect.

Password Grant you exchange a username / password once you’ve registered your API client and get back an API token your flutter app users can make requests with. Password Grant makes it so your user never has to leave the app.

Authorization Code Grant is considered more secure but requires your app to open a new browser window to the OpenEMR OAuth2 site where the user will then login with their credentials. Once the whole flow is complete you’ll get back an API token to make API requests.

You may want to watch some tutorial videos on OAuth2 as this could be something new for you, if you are struggling to understand the API documentation. You can also read up on SMART on FHIR+OAuth2 as it will be more healthcare specific and is what OpenEMR uses.

Now, if you’re trying to create patients with usernames / passwords we don’t currently have that in the APIs as the credentials have to be made via the GUI.