Error invalid client error description client id is incorrect

Ожидают ответа 1 человек. Станьте первым, кто даст ответ! Или подпишитесь на вопрос, чтобы узнать ответ, когда он появится.

Нужно получить данные по этому URL. Создал приложение вк, ввел вместо client_id айди своего приложения и в браузере вручную все работало:

https://oauth.vk.com/authorize?client_id=1&display=page&redirect_uri=http://example.com/callback&scope=friends&response_type=token&v=5.131

Затем попробовал в Postman сделать get запрос и получил ошибку 401Unauthorized.
И в самом Spring тоже самое: 401 Unauthorized: «{«error»:»invalid_client»,»error_description»:»client_id is incorrect»}».
Я уверен, что id ввел верно, перепроверял дважды. Вот код:

@SpringBootApplication
public class BlogApplication {

	private static final Logger log =
	LoggerFactory.getLogger(BlogApplication.class);

	public static void main(String[] args) {
		SpringApplication.run(BlogApplication.class, args);
		RestTemplate restTemplate = new RestTemplate();
		Map<String, String> uriVariables = new HashMap<String, String>();
		uriVariables.put("client_id", "Здесь мой id, палить не буду, но он написан правильно 100%");
		uriVariables.put("display", "page");
		uriVariables.put("redirect_uri", "http://vk.com");
		uriVariables.put("scope", "friends");
		uriVariables.put("response_type", "token");
		uriVariables.put("v", "5.131");
		Access access = restTemplate.getForObject("https://oauth.vk.com/authorize", Access.class, uriVariables);
		log.info(access.toString());
	}

}

Access.java (А это просто модель объекта, который хочу получить), создал три поля, так как после запроса я должен получить три единицы данных в ответе они написаны как «access_token», «expires_in», «user_id».

@JsonIgnoreProperties
public class Access {
    private Long token;
    private String expiresIn;
    private String userId;

    public Access() {}

    public Long getToken() {
        return token;
    }

    public void setToken(Long token) {
        this.token = token;
    }

    public String getExpiresIn() {
        return expiresIn;
    }

    public void setExpiresIn(String expiresIn) {
        this.expiresIn = expiresIn;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "Access [expiresIn=" + expiresIn + ", token=" + token + ", userId=" + userId + "]";
    }
    
}

Делаю авторизацию в вк по этому видео.

Постоянно выскакивает

{error: invalid_client, error_description; client_id is incorrect}

На устройстве имеется официальный вк клиент. Там я авторизирован. Пробовал удалить его — то же самое.
Когда записал этот официальный клиент снова, там я уже не был авторизирован. При этом в моем приложении тоже выплыло окно авторизации.
Когда же авторизировался в офиц клиенте, то в моем приложении появилась та же ошибка.

Nicolas Chabanovsky's user avatar

задан 16 фев 2016 в 15:50

Ruslan Korostik's user avatar

1

Всем, у кого возникает проблема error invalid_client error_description client_id is incorrect, необходимо добавить в манифест в тег <Application> строку android:name=".ClassName ", где ClassName – название класса, который вы унаследовали от android.app.Application и в одном из методов которого происходит вызов VKSdk.initialize();

alenkins's user avatar

alenkins

3,5791 золотой знак16 серебряных знаков28 бронзовых знаков

ответ дан 13 сен 2016 в 19:18

tukhfatov's user avatar

tukhfatovtukhfatov

911 серебряный знак2 бронзовых знака

У меня была такая проблема, потому что я не удалил двоеточия в sha1 ключе, когда регистрировал приложение в панели разработчика в vk.

ответ дан 25 мар 2017 в 16:01

Vlad's user avatar

VladVlad

1136 бронзовых знаков

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Open

denegny opened this issue

Sep 29, 2018

· 5 comments


Open

client_id is incorrect

#70

denegny opened this issue

Sep 29, 2018

· 5 comments

Comments

@denegny

Hi, your strategies is:

require 'omniauth/strategies/oauth2'

module OmniAuth
  module Strategies
    
   # Authenticate to Vkontakte utilizing OAuth 2.0 and retrieve
    # basic user information.
    # documentation available here:
    # http://vk.com/dev/authentication
    #
    # @example Basic Usage
    #     use OmniAuth::Strategies::Vkontakte, 'API Key', 'Secret Key'
    #
    class Vkontakte < OmniAuth::Strategies::OAuth2
      class NoRawData < StandardError; end

API_VERSION = '5.8'

but in app have
error | "invalid_client" error_description | "client_id is incorrect"

@mamantoha

Hi.

What are you trying to do? Do you set Secret key for you Vkontakte app?

@denegny

Hi.

What are you trying to do? Do you set Secret key for you Vkontakte app?

yes, in env

@mamantoha

Hi.

I checked and everything works correctly. It’s not an issue with the gem. Please double-check secret_key.

@ExplosiveGM

This code is confusing(readme.md):
provider :vkontakte, ENV['API_KEY'], ENV['API_SECRET']
Probably it can be better:
provider :vkontakte, ENV['VK_API_ID'], ENV['VK_API_SECRET']
I made mistake too

@mamantoha

@ExplosiveGM this makes sense. Can you update readme and create PR? Thanks.

rasul19752003


rasul19752003

  • 82
  • 13
  • #1

сайт : whowill.ru (не реклама) — проблемы с авторизаций вк! кто поможет Буду благодарен!
{«error»:»invalid_request»,»error_description»:»application was deleted»}

Что делать?

Healis


Healis

  • 797
  • 350
  • #2

сайт : whowill.ru (не реклама) — проблемы с авторизаций вк! кто поможет Буду благодарен!
{«error»:»invalid_request»,»error_description»:»application was deleted»}

Что делать?

Тут всё написано, если не знаешь англ —

У вас нет разрешения на просмотр ссылки, пожалуйста Войдите или Зарегистрируйтесь

ГРАФ


ГРАФ

  • 211
  • 63
  • #4

ну я понял! что нужно именно сделать?

приложение создай..

WebRage


Aroken

  • 96
  • 15
  • #7

{«error»:»invalid_client»,»error_description»:»client_id is incorrect»}
а это как фиксить??

Healis


Healis

  • 797
  • 350
  • #8

{«error»:»invalid_client»,»error_description»:»client_id is incorrect»}
а это как фиксить??

Перевести и понять ошибку

Aroken

  • 96
  • 15
  • #9

Перевести и понять ошибку

Я наверное и спрашиваю потому, что я уже все, что было в моих извилинах — перепробовал. Мало ли кто-то сталкивался именно с этой и может помочь.

AnubiS

  • 109
  • 66
  • #10

Я наверное и спрашиваю потому, что я уже все, что было в моих извилинах — перепробовал. Мало ли кто-то сталкивался именно с этой и может помочь.

Чтобы было более понятно:
1. Открываешь гугл переводчик
2. Выбираешь перевод с АНГЛИЙСКОГО(НЕ НЕМЕЦКИЙ, ИСПАНСКИЙ и т.п) на РУССКИЙ
3. В поле с АНГЛИЙСКИМ вставляешь «client id is incorrect»
4. Пытаешься понять то, что тебе ответили на русском

Aroken

  • 96
  • 15
  • #11

Чтобы было более понятно:
1. Открываешь гугл переводчик
2. Выбираешь перевод с АНГЛИЙСКОГО(НЕ НЕМЕЦКИЙ, ИСПАНСКИЙ и т.п) на РУССКИЙ
3. В поле с АНГЛИЙСКИМ вставляешь «client id is incorrect»
4. Пытаешься понять то, что тебе ответили на русском

Ты сам понял, что ты написал? Я говорю о том, что я очень долго сижу на одной ошибке и поэтому прошу помощи.

Aroken

  • 96
  • 15
  • #12

Чтобы было более понятно:
1. Открываешь гугл переводчик
2. Выбираешь перевод с АНГЛИЙСКОГО(НЕ НЕМЕЦКИЙ, ИСПАНСКИЙ и т.п) на РУССКИЙ
3. В поле с АНГЛИЙСКИМ вставляешь «client id is incorrect»
4. Пытаешься понять то, что тебе ответили на русском

Тебя когда дорогу спрашивают ты тоже отвечаешь типа «Гугл в помощь?». Если ты не можешь мне помочь, то зачем ёрничать и выписывать про гугл переводчик?

AnubiS

  • 109
  • 66
  • #13

Ты сам понял, что ты написал? Я говорю о том, что я очень долго сижу на одной ошибке и поэтому прошу помощи.

Так я тебе так описал, что даже сам сахаир поймёт. Просто воспользуйся переводчиком и ты получишь ответ, да он уже есть в той ошибке, что ты получил

Healis


Healis

  • 797
  • 350
  • #14

Тебя когда дорогу спрашивают ты тоже отвечаешь типа «Гугл в помощь?». Если ты не можешь мне помочь, то зачем ёрничать и выписывать про гугл переводчик?

Так ответ кроется в переводе

Aroken

  • 96
  • 15
  • #15

Так ответ кроется в переводе

Вот именно, что кроется. Если для тебя очевидно, это не значит, что каждому понятна проблема неверного идентификатора клиента. У меня впервые такая ошибка, вот и спрашиваю. Я всю ночь сижу с этими скриптами, хочу поставить наконец, последняя проблема всплыла такая и дрочусь с ней уже долго.

Healis


Healis

  • 797
  • 350
  • #16

Вот именно, что кроется. Если для тебя очевидно, это не значит, что каждому понятна проблема неверного идентификатора клиента. У меня впервые такая ошибка, вот и спрашиваю. Я всю ночь сижу с этими скриптами, хочу поставить наконец, последняя проблема всплыла такая и дрочусь с ней уже долго.

Ты, видимо, вручную писал этот клиент айди. Скопируй с приложения

Aroken

  • 96
  • 15
  • #17

Ты, видимо, вручную писал этот клиент айди. Скопируй с приложения

Не вручную. Я все копировал.

Healis


Healis

  • 797
  • 350
  • #18

Не вручную. Я все копировал.

Эх, не судьба нам всем увидеть новый топ проект(((

anatoliy123

  • 141
  • 49
  • #19

Такая же беда . Создал группу . Взял номер группы . Секретный ключь установил . И все одно пишет
{«error»:»invalid_request»,»error_description»:»application was deleted»}

XtReLL


XtReLL

  • 1,071
  • 479
  • #20

Такая же беда . Создал группу . Взял номер группы . Секретный ключь установил . И все одно пишет
{«error»:»invalid_request»,»error_description»:»application was deleted»}

В каком скрипте?

VK Sample

Table of contents

  • How to enable the provider
  • Settings
  • Common error messages

How to enable VKontakte login in WordPress

1. Create VKontakte App

  1. Navigate to https://vk.com/apps?act=manage
  2. Log in with your VK credentials if you are not logged in.
  3. Locate the blue “Create app” button and click on it.
  4. Enter the Title for your App and select “Website” as platform.
  5. Into the “Website address” field enter the URL of your homepage
  6. Fill the “Base domain” field with your domain name.
  7. When all fields are filled, click the “Upload app” button.
  8. Fill the information form of your app, upload an app icon then click Save.
  9. Pick Settings at the left-hand menu
  10. Into the “Authorized redirect URI” field add the URL that Nextend Social Login suggests at the backend.
  11. Save your app
  12. Find the necessary “App ID” and “Secure key” at the top of the Settings page where you just hit the save button.

2. App setup

Once your VKontakte app is ready you’ll need to copy and paste the Application ID and Secure key to the VKontakte provider’s Settings tab. You can find the information at your VKontakte app’s Settings which you can reach from the left sidebar.

3. Verifying

Once your Application ID and Secure key has been added you need to verify the setup first. This verification helps you identify possible problems with the app.

Settings

VK Provider Configuration

Application ID

The Application ID of your VKontakte app. You can find it at your App → left menu: Settings.

Secure key

The Secure key of your VKontakte app. You can find it at your App → left menu: Settings.

Username prefix on register

Whenever a new user registers with their VKontakte account they can get a custom prefix so you can easily identify them.

Fallback username prefix on register

Whenever a new user registers with their VKontakte account and we can not generate a valid username from the first name or last name, a random username will be generated. With this option they can get a custom prefix so you can easily identify them.

Terms and conditions

This option can only be seen, if Terms and conditions is set to Show in Global Settings → Privacy tab. Here you can set custom Terms and Conditions for users who register with VKontakte. For more information please read our GDPR documentation.

Common error messages returned by VKontakte during verification

redirect_uri has wrong domain

{“error”:”invalid_request”,”error_description”:”redirect_uri has wrong domain, check application settings”}

The problem is that the entered Base domain field is not correct for your app. Check the 6th step of the App setup to fix the problem.

redirect_uri is incorrect

{“error”:”invalid_request”,”error_description”:”redirect_uri is incorrect, check application redirect uri in the settings page”}

The problem is that the entered Authorized redirect URI field is not correct for your app. Check the 11th step of the App setup to fix the problem.

client_id is incorrect

{“error”:”invalid_client”,”error_description”:”client_id is incorrect”}

The entered Application ID is not correct. Maybe the app with the entered ID was deleted. Go to the VKontakte provider → Settings and make sure that an existing App’s Application Id and Secure key was entered.

client_secret is incorrect

Error: invalid_client: client_secret is incorrect

The Secure key you copied from the VKontakte app is invalid. Make sure the correct one was copied.

Понравилась статья? Поделить с друзьями:
  • Error invalid class object
  • Error invalid captcha response
  • Error invalid byte sequence for encoding utf8 0xff
  • Error invalid byte sequence for encoding utf8 0xd0
  • Error invalid byte sequence for encoding utf8 0x00