Skip to content
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

Access is denied due to invalid credentials. #265

Closed
Amir258 opened this issue Apr 16, 2020 · 14 comments
Closed

Access is denied due to invalid credentials. #265

Amir258 opened this issue Apr 16, 2020 · 14 comments

Comments

@Amir258
Copy link

Amir258 commented Apr 16, 2020

Opa, estou com esse problema, já vi todas as issues nenhuma me resolveu.

Eu criei as credentials tudo certinho, estou acompanhando a série do youtube, ja tentei 2 vezes.
Não sei porque continua dando o mesmo erro.

Está assim:

const watsonApiKey = require('../credentials/watson-nlu.json').apikey
const NaturalLanguageUnderstandingV1 = require('watson-developer-cloud/natural-language-understanding/v1.js');
 
var nlu = new NaturalLanguageUnderstandingV1({
  iam_apikey: watsonApiKey,                
  version: '2018-04-05',
  url: 'https://gateway.watsonplatform.net/natural-language-understanding/api/'
});

nlu.analyze({
    text: `Hi I'm Michael Jackson and I like doing the moonwalk dance move.`,
    features: {
        keywords: {}
    }
}, (error, response) => {
    if(error) {
        throw error
    };
    console.log(JSON.stringify(response, null, 4))
    process.exit(0)
});
@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Já dei um console.log ele ta me retornando a key certa.

@lorh4n
Copy link
Contributor

lorh4n commented Apr 16, 2020

Verificou se é apikey ou apiKey?

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Verificou se é apikey ou apiKey?

Ele ta retornando a api normal, dei um console.log, ou está falando ali da iam_apikey?

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Verificou se é apikey ou apiKey?

Vou mudar as credentials para ver se funciona

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Continua o mesmo erro

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Eu já exclui o serviço e criei denovo mesmo assim não consigo, continua o erro.

Se alguem aí souber como resolver me avisa aí

@lorh4n
Copy link
Contributor

lorh4n commented Apr 16, 2020

Tenta ve se voce encontra o seu problema nas issues #189 e na #155

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Tenta ve se voce encontra o seu problema nas issues #189 e na #155

Ué, eu instalo qual modulo? o que ele instalou no vídeo ou o ibm-watson?

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Tenta ve se voce encontra o seu problema nas issues #189 e na #155

Ja tentei fazer tudo, exclui e criar um novo serviço, tentar a conexão q tava na outra issue nada funciona.

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Tenta ve se voce encontra o seu problema nas issues #189 e na #155

Eu acho que talvez seja o url, o meu ta assim https://gateway.watsonplatform.net/natural-language-understanding/api/

@Amir258
Copy link
Author

Amir258 commented Apr 16, 2020

Ja consegui resolver, quem estiver com o mesmo problema, não esquece de puxar a url do json.

var nlu = new NaturalLanguageUnderstandingV1({
  iam_apikey: watson.apikey,                
  version: '2018-04-05',
  url: watson.url
});```

Ali em url

@Amir258 Amir258 closed this as completed Apr 16, 2020
@fabriciocunhauk
Copy link

fabriciocunhauk commented Jul 9, 2020

Também estava tendo o mesmo erro troquei o K do apiKey para k apikey e nada, mas quando troquei o k do
iam_apiKey: watsonApiKey, para iam_apikey: watsonApiKey, com k dai deu certo.

@PedroWagnerBomfim
Copy link

@fabriciocunhauk o meu deu certo, mas agora o erro que gerou foi no Node.

(node:8229) UnhandledPromiseRejectionWarning: authorization required
(node:8229) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8229) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@wendellunny
Copy link

@Amir258 Oh mano, ajudou muito, deu certo aqui. Vlww dms

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

No branches or pull requests

5 participants