Uploaded image for project: 'aaa'
  1. aaa
  2. AAA-157

Unable to create OAuth2 token for new user

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • Nitrogen-SR1
    • None
    • None

      While following tutorial on http://docs.opendaylight.org/en/latest/user-guide/authentication-and-authorization-services.html?highlight=aaa%7C#configuration-using-the-restful-web-service

      I've run into some issues

      Steps

      1 . Create OAuth token for user admin

      curl -X POST \
      http://localhost:8181/oauth2/token \
      -H 'Cache-Control: no-cache' \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -d 'grant_type=password&username=admin&password=admin&scope=sdn'

       

      Response 201

      { "access_token": "*TOKEN*", "token_type": "Bearer", "expires_in": 3600 }

       

      2. Create user domain

      curl -X POST \
      http://localhost:8181/auth/v1/domains \
      -H 'Authorization: Bearer TOKEN' \
      -H 'Cache-Control: no-cache' \
      -H 'Content-Type: application/json' \
      -d '

      { "name":"XY", "description":"XY domain", "enabled":true }

      '

      Response 201

      3.Create test user

      curl -X POST \
      http://localhost:8181/auth/v1/users \
      -H 'Authorization: Basic YWRtaW46YWRtaW4=' \
      -H 'Cache-Control: no-cache' \
      -H 'Content-Type: application/json' \
      -d '

      { "name": "test_user", "password": "12345", "domainid": "XY", "description": "Test user account", "email": "test_user@xy.tech" }

      '

      Response 201

      4. Create OAuth2 token for this user

      curl -X POST \
      http://localhost:8181/oauth2/token \
      -H 'Cache-Control: no-cache' \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -d 'grant_type=password&username=test_user&password=12345&scope=xy'

      Response 500

      {"error_description":"The Claim is missing one or more of the required fields.","error":"java.lang.IllegalStateException"}

       

            gvrangan Venkatrangan Govindarajan
            jsrnicek_cisco Jan Srnicek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: