How do I create an OAuth2 token?

I am struggling creating an oauth2 token.

Here’s what I tried:

  1. On openstreetmap.org, I went to → My Settings → OAuth 2 applications
  2. Clicked “Register new application”
    3a) entered name
    3b) entered “urn:ietf:wg:oauth:2.0:oob” for Redirect URL
    4a) Did not modify “Confidential application?” so it was clicked
    4b)_ Ticked ALL permissions
  3. Clicked “Register Application”
  4. I was presented with a client id and client secret
  5. Went to a shell and defined the variables
     CLIENT_ID="...."
     CLIENT_SECRET="..."
  1. Still in the shell:
    DOMAIN="https://master.apis.dev.openstreetmap.org"
    AUTHORIZATION_ENDPOINT=$(curl --silent $DOMAIN/.well-known/oauth-authorization-server | jq --raw-output '.authorization_endpoint')
    TOKEN_ENDPOINT=$(curl --silent $DOMAIN/.well-known/oauth-authorization-server | jq --raw-output '.token_endpoint')
  1. still in the shell: Determined Authorization Endpoint like so:

    echo $AUTHORIZATION_ENDPOINT?response_type=code&client_id=$CLIENT_ID&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=read_prefs

  2. Opened browser at given URL:

  3. I was asked to enter username and password.

  4. When I entered these, I was denied access with the somewhat meaningless error message “Sorry, could not log in with those details.”

I am now lost. How am I supposed to proceed?