Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Self-Hosted Linking "Invalid Redirect Request" #54

Open
zhdenny opened this issue Jun 25, 2020 · 2 comments
Open

Self-Hosted Linking "Invalid Redirect Request" #54

zhdenny opened this issue Jun 25, 2020 · 2 comments

Comments

@zhdenny
Copy link

zhdenny commented Jun 25, 2020

Everything self hosted running and able to access the gapi and gapi/auth and webserver etc.......but I have difficulty linking.

"The request by Google Home was malformed. Please try again in a few minute. If this problem persists, please contact the team of Kappelt gBridge. Invalid redirect Request!"

The Auth url does in fact have my Client ID correct....this is what the URL looks like where Google Home app takes me to Link...obscured my domain and Client ID

https://domain.com/gbridge/gapi/auth?redirect_uri=https%3A%2F%2Foauth-redirect.googleusercontent.com%2Fr%2Fgbridge-6f7ec&client_id=MY_CLIENT_ID&response_type=token&state=ABdO3MXu5m7eJGAb_WfMPNTMKNYwfMsoNb-rWbNY6-PERfXg20bAf6zqUc0t37ISpw2C-vOR-V4OuN4dZOVF0F_tOXHOQkKcMBYpXfiaPuacfDE_I1oac0tx6lx3s7ZuMXc0d_E6SfRPuUyJke6ZVS_Te6Z5JT6EtPMB9178LNo_TVzVOBCAk1meB0_N6wncQZkKb_abIUnU1al8FOMIGXudce0Vd-cX2nC4mqlwQdazdCDVvn94aT4BEqO9DsOKMXbhVLvfJzJgrNk5jht20MV3172BUk-0i-9fhQh1YG47MQhpkSvcM-dpioEr1IfEYDj0IjXbCUDkwhgyr6nOJWSNwwGnufElFk-t1FK_LHrjHKGLMHwSMnv4p0ixhdXMx7yVj296uXOG9HPgOl0fh2R9YvIwSB7KevmRtTS-rlFB1oPXhsrjr-Q1Dahwl3XweAy3_Fhd6mEcDgSxAvAWLvGAz9lscIMJvNUrYtPC9hqyPyRxCTcQtyFYLexTAhDtGAWcJuNpv7tsU2xEE9SP7SNR4rLbV17CtgLJjbra0RjZsRjXnrQIrFs&user_locale=en-US
@zegerk
Copy link

zegerk commented Jul 5, 2020

I also had some issues with that, url redirecting is tricky - after setting up letsencrypt for the SSL cert this ended up being my Nginx config:

events {
} 

http {
    resolver 127.0.0.11 ipv6=off;

    server {
    	listen 443 ssl;

    	ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
    	ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;

	ssl_protocols TLSv1.1 TLSv1.2;

	ssl_prefer_server_ciphers on;
	ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DHE+AES128:!ADH:!AECDH:!MD5;

    	#usually your public DNS name
    	server_name domain.com;

    	#SSL-settings and generic server options here

    	#the IP of the Docker host gBridge is running on
    	set $gbridge_host gbridge_web_1;

   	#the port you've defined for the gBridge web interface
    	set $gbridge_port 80;

        location ~ ^/gapi(/.*)?$ {
        	proxy_set_header Host $host;
        	proxy_set_header X-Real-IP $remote_addr;
        	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        	proxy_set_header X-Forwarded-Proto https;

        	proxy_pass http://$gbridge_host:$gbridge_port/gapi$1$is_args$args;
        }
    }
}

Note also to set the following in the docker config for gBridge web service:

         PROXY_URL: 'https://domain.com/gapi'
         PROXY_SCHEME: 'https'

@nayneyT
Copy link

nayneyT commented Feb 16, 2021

Hi everybody.

If you use use NodeRed as part of your home assistant setup then I suggest you take a look at https://github.com/mikejac/node-red-contrib-google-smarthome and https://flows.nodered.org/node/node-red-contrib-google-smarthome

It's an absolute shame that this project died.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants