Issue with Google sign-in using self-hosted app

What I’m trying to do:
I’m currently creating an app that is being used by people in my organisation, I now need to move the site to an on-site install of Anvil. After doing this, the system fails when using sign-in with Google (the only authentication option) and yields the error: “We could not find an app that matched your request. You may have copied the URL for this app incorrectly…”.

What I’ve tried and what’s not working:
To authenticate, I am using anvil.users.login_with_google().
This issue is happening in the Anvil editor.
I think, potentially, this issue is due to incorrectly moving the project to the on-site install, I’m not sure how I ‘tell’ the app to serve the files from the server and not the cloud,

Hi @mjdavies,

Just to clarify, are you talking about using the App Server here, or do you have a full on-site Anvil Enterprise installation? I assume you’re talking about hosting your app yourself with the open-source App Server, but it’s worth being clear.

If you are using the App Server, you’ll need to set up your own Google application to authenticate against (with these instructions, but substituting https://your-app.domain/_/client-auth-calllback as the callback URL), and then use that client ID and secret in your App Server config (see docs).

If you’re using a full on-site Anvil Enterprise installation, then you can use one-click Google authentication just like you can on anvil.works, without setting up a Google API project for every app. Your Enterprise administrator will need to set up a Google client ID and secret in the Anvil Enterprise configuration file, and then anyone using that installation can use Google authentication out-of-the-box without any per-app setup.

1 Like

Hi @meredydd ,

Apologies for my slow reply on this! We’ve only just got round to changing our system round!

I believe we are using an App Server and not a full on-site install, thank you for clarifying!
The instructions you provided have definitely yielded some progress! However, now I’m receiving the error:
“Attempted to decrypt an encrypted value (‘google-service/client-secret’) from the anvil.works hosted platform. This should be specified in the App Server configuration instead.”

I’ve checked and my Anvil Google API service has both the Client ID and Secret stored in the provided fields.
I’ve attempted to Google around the matter, but can’t seem to find anything of relevance!
Any help is much appreciated!