invalid client id or redirect uri

INVALID_CLIENT: Invalid redirect URI error when running GitHub pages application. Uses Spotify API

I’ve deployed a React application to GitHub pages that uses the Spotify API to get the currently playing track on Spotify and display it in the web page. This runs great locally and used a local server running on port 8888 to send the api requests and redirect to the app running on localhost:3000. The issue is that the app as is gives the above error when I attempt to request the token from the Spotify API and I’m guessing it’s because the redirect uri that I’m using is no longer valid since the app is now on GitHub and can’t communicate with localhost:3000.

The following is the code that ran on localhost:8888 and retrieved the access token. I changed my redirect URI to match the location of the hosted version of the app.

The following is the code for the app itself. I’m sure I need to change the href attribute in the link to go somewhere other than localhost:8888 but I’m not sure exactly where.

invalid client id or redirect uri. Смотреть фото invalid client id or redirect uri. Смотреть картинку invalid client id or redirect uri. Картинка про invalid client id or redirect uri. Фото invalid client id or redirect uri

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Browse other questions tagged reactjs spotify github-pages or ask your own question.

Related

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.9.16.40232

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Invalid client id or redirect uri #28865

Comments

Vinz87 commented Nov 18, 2019 •

Home Assistant release with the issue:

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Python3.7 virtual environment

Integration:

Description of problem:
Sorry for cross-posting from the iOS App Github page, but I’m really out of ideas.
I get that error whenever I try to connect from the iOS app.
Tried both local and DDNS address. Both of them work if accessed from the browser.
It used to work in the past, I don’t what changed.
Problem appears also on a fresh HA install.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

Traceback (if applicable):

The text was updated successfully, but these errors were encountered:

We are unable to convert the task to an issue at this time. Please try again.

The issue was successfully created but we are unable to update the comment at this time.

frenck commented Nov 18, 2019 •

I don’t see a direct reason / issue with this myself.

However, looking at your configuration, please note that the base_url in the http section needs to be a full URL, e.g., http://my.duckdns.org:8123 (so including the http:// or https:// part).

Vinz87 commented Nov 18, 2019 •

well I intended to show like that because, as I mentioned, I get this issue with a fresh install, so with the configuration.yaml that comes with a brand new install.

It used to work out of the box, so setting base_url shouldn’t be necessary.

Anyway, I’ve tried also the base_url, both http://RASPBERRYPI_IP:8123 and http://DDNS_ADDRESS:8123, neither of them work. Both of them work if accessed from the browser.

Again, I don’t know if it’s not related to Home Assistant so I may be out of topic here, but I don’t know where to look to solve the problem, so maybe starting here is a good idea.

frenck commented Nov 18, 2019 — with Octobox

Is there anything in the logs?

As in, we use GitHub to track actually known issues. At this point, I kinda feel like this is a support issue at this point.
I would highly recommend on joining our Discord chat server. There are many people in there that know their way around these things.

Vinz87 commented Nov 18, 2019

@frenck I’ve downloaded the app but didn’t understand how to join the channel, could you give me advice on that?

Vinz87 commented Nov 18, 2019 •

the relevant part of the logs, I don’t know if I can get more information by enabling more detailed logs, perhaps of the http component

frenck commented Nov 18, 2019 — with Octobox

You can join the chat by visiting this URL: https://home-assistant.io/join-chat

Vinz87 commented Nov 18, 2019

I’ll ask there, thank you

Vinz87 commented Nov 20, 2019

Unfortunately I still have to find a solution to this problem, which I don’t know if it’s a bug or not.
I tried reinstalling Home Assistant & iOS app several times; I reset all the python3.7 virtual environment; I tried installing different HA versions.
I got a couple of answers on Discord channel but found it not very responsive to questions outside the topic that is going on in the chat.

The only thing that worked was to downgrade iOS app to v1.1.1, which I guess has a different type of authentication method.
Current v1.5.1 and beta v2.0 give this problem to me, on different devices.

Vinz87 commented Nov 21, 2019

After trying to completely disable IPv6 from my network as suggested by the app developer on the Discord channel, without solving the issue, I finally flashed the last version of Raspbian Buster on the Raspberry Pi.
On top of that brand new OS I followed the manual installation instructions (which means I also upgraded to HA v0.102.0), and I can report the issue disappeared on the v2.0beta and v1.5.1 iOS app.

I still don’t know the reason of the problem but I consider the issue closed.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

[Question] Invalid redirect_uri / unauthorized_client #1223

Comments

Franklin89 commented Jun 1, 2017

I am running into a configuration problem and I am not sure how to solve it.

Currently running an IdentityServer4 instance on Azure. Developing a MVC Client Application Locally on my Dev Machine using Docker. I want to authenticate via the IdentityServer4 on Azure. I keep running into the same error.

Not sure if this is even possible or if I am going completly wrong here.

Thanks for any hint 🙂

The text was updated successfully, but these errors were encountered:

We are unable to convert the task to an issue at this time. Please try again.

The issue was successfully created but we are unable to update the comment at this time.

Mardoxx commented Jun 1, 2017 •

chrisowhite commented Jun 1, 2017 •

@Mardoxx You are correct. The default redirect URL validator does a case insensitive compare on the full URL.

Franklin89 commented Jun 2, 2017

This is totally embarrassing.
I was looking at the log message for hours and did not see that 👎

@Mardoxx Thanks for pointing it to me. got it working again.

hugorojass commented Sep 17, 2017

I have a problem similar to @Franklin89, I developed my IdentityServer using the netcoreapp1.1 framework, IdentityServer4 version 1.52, with a console client the connection works fine, but with an MVC client netcoreapp2.0, within the records shows me:

Источник

Описание ошибок протокола OAuth 2.0

В данном разделе приводится описание ошибок, возникающих при выполнении запросов в рамках протокола OAuth 2.0 и OpenId Connect 1.0.

В случае возникновения ошибок сервер возвращает информацию в двух полях:

Далее будет представлена информация по кодам ошибок.

Ошибки конечной точки /authorize

invalid_request

В запросе не передан обязательный параметр, либо значения переданного параметра некорректно, либо параметр пристутствует в запросе несколько раз, либо весь запрос имеет неправильный формат.

Возможные причины

unauthorized_client

Клиент с указанным в запросе идентификатором не зарегистрирован, отключён, либо клиенту запрещено получения маркера доступа в рамках данного сценария.

Возможные причины

unsupported_response_tpe

Тип ответа не поддерживается.

Указанный в запросе response_type не поддерживается.

Возможные причины

invalid_scope

Неправильная область использования.

Указанный в запросе scope не зарегистрирован на сервере.

Возможные причины

login_required

Запрос не может быть выполнен в интерактивном режиме (с указанием параметра prompt со значением none ).

Возможные причины

Ошибки конечной точки /token

invalid_request

В запросе не передан обязательный параметр, либо значения переданного параметра некорректно, либо параметр пристутствует в запросе несколько раз, либо весь запрос имеет неправильный формат.

Возможные причины

invalid_client

Не удалось осуществить аутентификацию клиента.

Возможные причины

invalid_grant

Разрешение, используемое клиентом, не является действительным.

Возможные причины

unauthorized_client

Клиент с указанным в запросе идентификатором не зарегистрирован, отключён, либо переданы неверные учётные данные клиента.

Возможные причины

usupported_grant_type

Неподдерживаемый тип разрешение.

Разрешение, используемое клиентом, не поддерживается сервером.

Возможные причины

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *