Sync Gateway 3.0 User Creation via Google Endpoint

Hi, I am using the Sync Gateway 3.0 and want to enable the User creation via Google with a Gateway request to {url}/{db}/_google, but the endpoint only gives back a 404 Not found error…

Current Sync Gateway database config:

{
    "bucket": "travel-sample",
    "name": "travel-sample",
    "guest": {
        "disabled": true
    },
		"oidc": {
				"default_provider": "google",
				"providers": {
					"google": {
						"issuer": "https://accounts.google.com",
						"register": true,
						"client_id": "{CLIENT_ID}",
						"validation_key": "{KEY}",
						"callback_url": "http://localhost:4984/default/_oidc_callback"
					}
				}
			},
    "import_docs": true,
    "num_index_replicas": 0,
    "enable_shared_bucket_access": true
}

Has anyone an idea how to use the Google Auth properly to register a new user?
The Google Auth is set up and gives me a bearer token back, but I don’t know how to use it in this context…
Edit: Just noticed that the Google Auth is deprecated in SG 3.0, but is there any other way to get it running without using the old legacy config?
Thanks in advance (:slight_smile:

Hi,

You should be able to use Google’s OpenID Connect provider using the generic OIDC config:

I added the following config to the sg database and finally managed to create a new sg user by providing the Google Bearer Token to the oidc Endpoint {url}/{db}/_oidc?provider=googleimplicit. After a user is created it’s now possible to open a sg session by passing the Google token to the _session Endpoint :+1:

"oidc": {
        "providers": {
          "googleimplicit": {
            "issuer":"https://accounts.google.com",
            "client_id":{CLIENT_ID},
            "register":true 
          }
	}
}
3 Likes