1. What is OAuth and why do I care? - token


Hi, I can't get this the first exercise to work with any of the two tokens. Is there a new one?

  • token = "1c4b40471046fdb5d0ff81570c7564fe244940c2"
  • token = "e6a75d6b6d7b0fdd0eee93fd3c141d808852a0e9"


Same not working for me too


I got it to work with this code:

require 'httparty'

token = "1c4b40471046fdb5d0ff81570c7564fe244940c2"

user = HTTParty.get "https://api.github.com/user", 
    :headers => { 
                    "Authorization" => "token #{token}",
                    "User-Agent" => "codecademy"    

puts "Hi, my username is api-padawan" it will work.

Don't put It will work in a string.


I am also facing the same issue. Even after giving right token, I am getting an error.


Not working for me either, error message: > "Oops, try again. It looks like your code didn't print the correct username! Click the red Reset button, then click run."

puts user gives the following hash:

{"message"=>"Bad credentials", "documentation_url"=>"https://developer.github.com/v3"}

Workaround solution posted by @javapro45590 does not fix it for me, either.

UPDATE: Temporary solution found. You have to intentionally produce a syntax error, for example put a comma at the end of a line. It'll display an error message, but it'll also show "Way to go!" and lets you move on.


I was able to make this work via IRB using the same code (but my own GitHub API token). So code is ok, but exercise validator is not.


Still broken, api-padawan's code doesn't work either.


The correct token is used later on @ 4. Tokens up close

token = "c8196abdbdcf0e87fcd065d1e07cb2be7ecd682c"


Hi, my username is api-padawan

New error...

Oops, try again.
Did you accidentally delete the token string? Click the red Reset button, then click Run!


I'm getting this latest error too


Still doesn't work with the default token, same error message.