Authorization grant flow 404 Error

Hey all,

I have tried to do the Authorization grant flow on demo open emr website to read the patient datas through fhir , Below are the steps i have followed:

1.)Registration of the Api:

It gave me back the below details:

{“client_id”:“ds5XmdA3drltW8wldywmdtDa5msqnlVDK-3Yt6ypt2g”,“client_secret”:“0H_v2ucq4W-HLGMlpa9_G_G3k6yNHBWx8BYph5mtydZQLCbAYf80LVIe4HNV4NBCL1P5LkxUZJBaapQlidUg1Q”,“registration_access_token”:“kU-gsxzeuYrnDs5LX5t8SzD59CIfxsNASfQGUK2ZaLA”,“registration_client_uri”:"https://six.openemr.io/a/openemr/oauth2/default/client/bD8ro2WMKM96qKU6ZEtYzw",“client_id_issued_at”:1678862293,“client_secret_expires_at”:0,“client_role”:“user”,“contacts”:[“me@example.org”,“them@example.org”],“application_type”:“private”,“client_name”:"A

Private

App",“redirect_uris”:"[https://six.openemr.io/a/openemr/callback"],“post_logout_redirect_uris”:[“https://six.openemr.io/a/openemr/logout/callback”],“token_endpoint_auth_method”:“client_secret_post”,“scope”:"api:fhir

api:oemr openid user/Patient.read user/patient.read"}

2.) Authorization:

OpenEMR Authorization api:fhir api:oemr user/Patient.read user/patient.read

I have used the Above link for the Authorization purpose which took me to the login page and after entering it i have given Authorize Access.

which returned me the below link with the Authorization code:

https://six.openemr.io/a/openemr/callback?code=def502001baa3c7d8038518d7f384755ac21d377a8ce65bd3a69d4f9ebb5ebf3bfdcb9895eb800d3d146fec4098543aff12db52ebcb2f65f4aa418549066a908e5905dd6b3e36f8569220dd859054f1a404fc50999da4a1c36bfc7207d852cca3e9575f4038725b5f0051f8e7a9f64302427217311e63bdf8c2439d92a18211a285abd5196e43486ec733f71f7091cc197c5ce1fceea305c610242d1511ebc733f40b1475ed1f95bb7eedc9527ac33845af87430d810a9d045116ada403f99bf41302f867c9e25d8175befdd96ed7af77f07678da7646924bf78efd61f8d9d00586e8a78fc33dddf7d17c3ee1aed43e02f7a3a29c2ae04bbe88398381a5651dffc7a0d311ed85200a67362ac3e8107dba7107e42ad7c04fed1cd46ae52aaddd51911b456b28f5c4553ed1b0472971738b3b7cd4b8bde2e20ae987935be499ba24e93d78cc3294de90e6232215618f3b05d2582241d428d03ad5f90f3248ea666ab3453fe0dd1ce71f59a5ac7cbd61527e5dc0c98c899b9f17bd45c199bd7fc35e33dbfdd7a500f7cf7da2688a6d0deabb327cdce04f63189c16d9282dbaaea0b3e1132d3a5c2f402bf09c5addafae8ac33c6477f74f0116aa4475acd42349beecd167cbd3d179940978b0e5ddfdbadd98c33689037d2&state=a95b970548dd8880ddb7c3192439f468fe63396f

3.) Fetching Access token using the Auth Code:

It returns me a 400 error:

Kindly let me know what is the issue here and where i am going wrong.

@adunsulag @stephenwaite @brady.miller @Mandrake

Here is a stupid question. Have you tried to use Swagger? You can do all this testing from within Swagger to develop and test your connections to the server.

1 Like