Core: Problems with fitbit integration authorization

Created on 1 Jun 2020  Â·  10Comments  Â·  Source: home-assistant/core

The problem

Problems with fitbit integration authorisation
My FitBit Integration was working until yesterday, 20/05/20 and this was prior to the Home Assistant 0.110.0 update but I did update NGINX, not sure if that was the cause but I suddenly lost all my sensors.

I am now trying to re authorise but coming up with

image

No matter what combination of yaml i cannot change this from my local I.P. address.

also even though I have DuckDNS and NGINX running I still get the callback

image

I have tried including

  external_url: https://redacted.duckdns.org
  internal_url: http://192.168.0.63:8123
  ```
commenting out the old config

http:

base_url: !secret base_url

ssl_certificate: /ssl/fullchain.pem

ssl_key: /ssl/privkey.pem

ip_ban_enabled: true

login_attempts_threshold: 10

I tried putting my base url back in but still the same

I re entered my credentials https://dev.fitbit.com/apps and updated my fitbit.conf

I also tried changing the fitbit url callback

https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=22BFPK&redirect_uri=**http://192.168.0.63:8123**/api/fitbit/callback&scope=activity+heartrate+nutrition+profile+settings+sleep+weight&state=XSqzPjzwUOne0qgquTHXlW2LeoY1gu

to  
![image](https://user-images.githubusercontent.com/60036872/83396449-e7d38180-a3f3-11ea-8ffd-40e76cc8787f.png)


Any suggestions to what I am doing wrong or is there a problem with FitBit site?


## Environment

arch | armv7l
-- | --
chassis | embedded
dev | false
docker | true
hassio | true
host_os | HassOS 3.13
installation_type | Home Assistant
os_name | Linux
os_version | 4.19.114-v7l
python_version | 3.7.7
supervisor | 225
timezone | Europe/London
version | 0.110.4
virtualenv | false


## Problem-relevant `configuration.yaml`
<!--
  An example configuration that caused the problem for you. Fill this out even
  if it seems unimportant to you. Please be sure to remove personal information
  like passwords, private URLs and other credentials.
-->

```yaml

Traceback/Error logs


Additional information

fitbit

Most helpful comment

I got it working again by setting both my internal url and external url to my https://redacted.duckdns.org in my configuration.yaml.After clearing cache and restarting HA my redirect for authorisation was my https and I succeeded in getting a new token.I know it is not the best or correct way but it worked so give it a try.

Sent from Yahoo Mail on Android

On Wed, 8 Jul 2020 at 21:23, frlarsendeloittenotifications@github.com wrote:

I can remember this exact same problem many months ago. Been working fine for ages, just until now.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

All 10 comments

I have the same issue. I was able to update my fitbit.conf using a script I wrote over the weekend to pull the necessary auth info and backdoor the integration. I experienced the exact same problems you are. I even tried making fitbit a custom_component and was unable to make the fitbit integration auth work.

Hey there @robbiet480, mind taking a look at this issue as its been labeled with a integration (fitbit) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

This is the same as my issue on #33198

I've got this issue too. Would be nice if this has been fixed.

I've changed some values to get the auth page of Fitbit where i can select checkboxes;

https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=6_CHAR_CLIENT_ID&redirect_uri=https://EXTERNAL_URL_HASSIO/api/fitbit/callback&scope=SCOPES&state=STATE_HASH

But after pressing 'allow', i'm getting a 500 on my hassio installation.

I was having the same problem as well. I noticed the ..api/fitbit/callback in the redirect_uri parameter that Fitbit was complaining about and updated my Fitbit app to include that which allowed me to get around it. (ie. set the Callback URL on dev.fitbit.com as 'http://127.0.0.1:8123/api/fitbit/callback')

Not sure if the problem is the FITBIT_AUTH_START or FITBIT_AUTH_CALLBACK_PATH misconfigured?

Same annoying problem here, it was working but somehow lost the token. Unable to reauthenticate with fitbit.

I can remember this exact same problem many months ago. Been working fine for ages, just until now.

I got it working again by setting both my internal url and external url to my https://redacted.duckdns.org in my configuration.yaml.After clearing cache and restarting HA my redirect for authorisation was my https and I succeeded in getting a new token.I know it is not the best or correct way but it worked so give it a try.

Sent from Yahoo Mail on Android

On Wed, 8 Jul 2020 at 21:23, frlarsendeloittenotifications@github.com wrote:

I can remember this exact same problem many months ago. Been working fine for ages, just until now.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

@markbooth73 Thank you so much! It's was the internal URL that worked like a charm.
I have HA on a domain, a port no. and ssl, but it works again!

Tagging @smashley3000 @ktpx @IIAIronWolf @neforce, so they can see it as well.

I got it working again by setting both my internal url and external url to my https://redacted.duckdns.org in my configuration.yaml.After clearing cache and restarting HA my redirect for authorisation was my https and I succeeded in getting a new token.I know it is not the best or correct way but it worked so give it a try.

@markbooth73 Thank you so much! It's was the internal URL that worked like a charm.
I have HA on a domain, a port no. and ssl, but it works again!

Tagging @smashley3000 @ktpx @IIAIronWolf @neforce, so they can see it as well.

I got it working again by setting both my internal url and external url to my https://redacted.duckdns.org in my configuration.yaml.After clearing cache and restarting HA my redirect for authorisation was my https and I succeeded in getting a new token.I know it is not the best or correct way but it worked so give it a try.

I got it working again by setting both my internal url and external url to my https://redacted.duckdns.org in my configuration.yaml.After clearing cache and restarting HA my redirect for authorisation was my https and I succeeded in getting a new token.I know it is not the best or correct way but it worked so give it a try. Sent from Yahoo Mail on Android On Wed, 8 Jul 2020 at 21:23, frlarsendeloittenotifications@github.com wrote: I can remember this exact same problem many months ago. Been working fine for ages, just until now. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Great guys! Works like a charm, getting a token now!

Was this page helpful?
0 / 5 - 0 ratings