kevindeland / cuantos-caminos

1 stars 3 forks source link

Info: {"code":401,"error":"Unauthorized: Access is denied due to invalid credentials"} #2

Closed loretoparisi closed 8 years ago

loretoparisi commented 8 years ago

Hi, I'm not sure which service (Spotify / Genius) is giving back this oAuth error. I'm logged in Spotify and I have setup Genius API as well.

Que cantó esto?? (Who sings this?)

{"code":401,"error":"Unauthorized: Access is denied due to invalid credentials"}

I have also setup in spotify the web site / redirect url to http://localhost:#PORT/callback (like the Spotify callback), not sure if it is correct.

I can see from the console logs that I have genius annotations loaded, a result from the spotify api like:

     { section: 'JournoList',
       line: 'A few weeks ago, its editor, Tucker Carlson, asked if he could join the list. After asking all of you, I said no, that the rules had worked so far to protect people, and the members weren\'t comfortable changing them. He tried to change my mind, and I offered, instead, to partner with Carlson to start a bipartisan list serv. That didn\'t interest him. In any case, Journolist is done now. I\'ll delete the group shortly after I send this out. That\'s not because Journolist was a bad idea, or anyone on it did anything wrong. It was a wonderful, chaotic, educational discussion.' },
     { section: 'JournoList',
       line: 'I\'m proud of having started it, grateful to have participated in it, and I have no doubt that someone else will reform it, with many of the same members, and keep it going. But insofar as its archives have become a weapon, and people\'s careers are at stake, it has to die. Thanks for everything' } ] }
random index 122
found random verse [object Object]
got verse Ray is cursed tonight. book. Never OPEN
picked track {"song":"Won't Get Fooled Again - Original Album Version","artist":"The Who","verse":"Ray is cursed tonight. book. Never OPEN","index":12,"correct":true}
choosing track {"song":"Born To Be Wild","artist":"Steppenwolf"}
choosing track {"song":"Should I Stay or Should I Go","artist":"The Clash"}
choosing track {"song":"Love Her Madly","artist":"The Doors"}
{ tracks: 
   [ { song: 'Should I Stay or Should I Go', artist: 'The Clash' },
     { song: 'Love Her Madly', artist: 'The Doors' },
     { song: 'Born To Be Wild', artist: 'Steppenwolf' },
     { song: 'Won\'t Get Fooled Again - Original Album Version',
       artist: 'The Who',
       verse: 'Ray is cursed tonight. book. Never OPEN',
       index: 12,
       correct: true } ],
  correct_i: 3 } 3
ERROR: {"code":401,"error":"Unauthorized: Access is denied due to invalid credentials"}
loretoparisi commented 8 years ago

Ok that was the Watson Translation API username/account issue.

Last problem, but not least the IBM login:

$cf login -u myaccout@mydomain.com -o myaccout@mydomain.com -s dev

Endpoint API: https://api.ng.bluemix.net

Password> 
Autenticazione in corso...
OK

NON RIUSCITO
Errore durante la ricerca dell'organizzazione myaccout@mydomain.com
Organization myaccout@mydomain.com non trovato

Endpoint API:   https://api.ng.bluemix.net (versione API: 2.40.0)   
Utente:        myaccout@mydomain.com   
Non sono stati specificati organizzazioni o spazi, utilizza 'cf target -o ORG -s SPACE'

It gives back the ERROR: "Error while searching for organization myaccout@mydomain.com, organization myaccout@mydomain.com not found."

but I have checked my (trial) account and the organization is there.

kevindeland commented 8 years ago

@loretoparisi

when you say that "the organization is there", where have you checked?

if you login to https://console.ng.bluemix.net/ and click on the face in the top right hand corner, what do you see? image You should be able to ensure your organization is created. image

You can also check which orgs exist with the command cf orgs, then target your org and space using cf target -o ORG_NAME -s SPACE_NAME

Is your organization listed there?

kevindeland commented 8 years ago

If the org is listed and the target command still does not work, please let me know.

loretoparisi commented 8 years ago

Yes @kevindeland on the dashboard I can see that organization is the same of my email account, and following the instructions there, I have used the same cf commands.

But using the org lists, I cannot find it:

macbookproloreto:tone-analyzer-nodejs admin$ cf target -o loreto@musixmatch.com -s dev
NON RIUSCITO
Non è stato possibile specificare l'organizzazione di destinazione.
Organization loreto@musixmatch.com non trovato

It says "organization xxxx not fond" but I can see it:

schermata 2016-02-05 alle 15 00 13

loretoparisi commented 8 years ago

uhm could it be that the cf tool does not select the right region I have UK...

kevindeland commented 8 years ago

Yup, that's it. I switched to the EU/GB api and none of my orgs were there.

Instructions here:

https://www.ibm.com/developerworks/community/blogs/enablingwithbluemix/entry/regions_in_bluemix?lang=en

kevindeland commented 8 years ago

Updated README with instructions, closing this issue, thanks loreto!