OpenEMR Google Sign-On does not work

Screen shot is attached

When I tried to upload video in this reply
i am getting “Sorry new user cannot upload” message
Thanks

https://vimeo.com/manage/videos/751177115/371a847030

1 Like

It seems like you are on the right track. The SDK needs to be updated. Have you tried to update the code and the SDK?

How to update SDK?

Accpording to this link [Migration von Google Log-in | Sign In With Google | Google Developers] I tried to make code changes to
this

<div id="g_id_onload"
     data-client_id="YOUR_CLIENT_ID"
     data-ux_mode="redirect"
     data-login_uri="https://www.example.com/your_login_endpoint">
</div>
<div class="g_id_signin" data-type="standard"></div>

changed data-login_uri = “interface/main/tabs/main.php”
However,
I am getting this error
Site ID is missing from session data!

Can you help me ?
Thanks

Here are the instruction I found to update the sign in system.

Updated SDK . it did not help.

I made changes by folowing this instruction on templates/login/login_core.html.twig

<script src="https://accounts.google.com/gsi/client" async defer></script>
<div id="g_id_onload"
     data-client_id="YOUR_CLIENT_ID"
     data-ux_mode="redirect"
     data-login_uri="https://www.example.com/your_login_endpoint">
</div>
<div class="g_id_signin" data-type="standard"></div>

However, it did not work.
what should be our “your_login_endpoint” in openemr ?
data-login_uri=“https://www.example.com/your_login_endpoint”>

Thanks

Change this:

 $.getScript('https://apis.google.com/js/platform.js', function (data, textStatus, jqxh) {

to this:

      $.getScript('https://accounts.google.com/gsi/client', function (data, textStatus, jqxh) {

Let me know if it works.

It did not work

it does not show even Google sign in button and show
it shows error gapi is not defined

thanks

Ok, I was trying what you suggested. According to the migration document. The JavaScript should be called from this link.

 apis.google.com/js/api.js

Let me know if this works.

Replaced url https://accounts.google.com/gsi/client
to https://apis.google.com/js/api.js

getting this error

Thanks

So, it looks like there is more to it than just replacing the endpoint. Apologies that did not work out. Maybe if you follow the instruction of the migration document to send the correct information to the endpoint. It should work. According to the message in the console the endpoint change is a step in the right direction. Maybe @robert.down will have time to refactor this into something usable.

Be sure to put back the original endpoint.

Best!

Will you plan to make changes related to this

“You have created a new client application that uses libraries for user authentication or authorization that will soon be deprecated. New clients must use the new libraries instead; existing clients must also migrate before these libraries are deprecated. See the [Migration Guide] for more information.” ?

Unfortunately no. I have no plans to work on this. I was hoping that I could help you find a way to get it to work. That is why I pinged @robert.down because he was the one that possibly wrote this and is more familiar with the code and process than I am. I would have to burn time learning how it works before I can make any changes to make it functional.

@ken @growlingflea Implemented this.

Thanks for the correction @sjpadgett.
Maybe @ken or @growlingflea can jump in on this and service the issue.

1 Like

I made changes to templates/login/login_core.html.twig file and fixed this issue by my self.

I can send you my changes. What is the procedure to submit fixes for OpenEmr? Should I push it to special github?

Thanks

I made changes to templates/login/login_core.html.twig file and fixed this issue by myself.

I can send you my changes. What is the procedure to submit fixes for OpenEmr? Should I push it to special github?

Thanks

1 Like

Congratulations!
Post the changes here. I will get them into a repo.

If you have a GitHub account, go ahead and create a pull request.