Spotify wont authenticate

I’m struggling to get Spotify to authenticate and complete the integration.

I have my developer account all setup and can see the API via the Spotify console and the app in the dashboard

HA though is getting the wrong redirect URL in the authenticate request (http://xxxx.duckdns.org.uk/api/spotify rather than https) - but if I fix that the response causes a return error…

# 500 Internal Server Error
Server got itself in trouble

HA logs has :-

020-01-12 13:26:26 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 120, in handle
    result = handler(request, **request.match_info)
  File "/usr/src/homeassistant/homeassistant/components/spotify/media_player.py", line 157, in get
    self.oauth.get_access_token(request.query["code"])
  File "/usr/local/lib/python3.7/site-packages/spotipy/oauth2.py", line 218, in get_access_token
    raise SpotifyOauthError(response.reason)
spotipy.oauth2.SpotifyOauthError: Bad Request

Any suggestions ?