Getting error 401 when use get token by token method

Bug #1909119 reported by Seyed Milad Hashemi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
New
Undecided
Seyed Milad Hashemi

Bug Description

I have scenario that first I authenticate user with username and password with explicit unscoped and receive a token.
By using the token I request user projects list and getting projects id, then at last using one of project id and unscoped token I want to get project scoped token.

This scenario happens with three api call:
1
url: {{KEYSTONE_BASE_URL}}/v3/auth/tokens
request:
{ "auth": {
    "identity": {
      "methods": ["password"],
      "password": {
        "user": {
          "name": "tester",
          "domain": { "id": "default" },
          "password": "testing"
        }
      }
    },
    "scope": "unscoped"
  }
}

response:
header:
X-Subject-Token : token_id

2
url: {{KEYSTONE_BASE_URL}}/v3/auth/projects

request:
header:
X-Auth-Token: token_id

response:
{
    "links": {
        "self": "http://key:5000/v3/auth/projects",
        "previous": null,
        "next": null
    },
    "projects": [
        {
            "is_domain": false,
            "description": "",
            "links": {
                "self": "http://key:5000/v3/projects/5e9609787c4640118e8e007a25b30e4c"
            },
            "tags": [],
            "enabled": true,
            "id": "5e9609787c4640118e8e007a25b30e4c",
            "parent_id": "default",
            "domain_id": "default",
            "name": "test"
        },
        {
            "is_domain": false,
            "description": "",
            "links": {
                "self": "http://key:5000/v3/projects/fb7822bd49614bd8bbaf133576e3e324"
            },
            "tags": [],
            "enabled": true,
            "id": "fb7822bd49614bd8bbaf133576e3e324",
            "parent_id": "default",
            "domain_id": "default",
            "name": "test2"
        }
    ]
}

3
url: {{KEYSTONE_BASE_URL}}/v3/auth/tokens

request:
body:
{
    "auth": {
        "identity": {
            "methods": [
                "token"
            ],
            "token": {
                "id": "'token_id"
            }
        },
        "scope": {
            "project": {
                "name": "test",
                "domain": {"id":"default"}
            }
        }
    }
}

response:
body:
{
    "error": {
        "message": "The request you have made requires authentication.",
        "code": 401,
        "title": "Unauthorized"
    }
}

description: updated
description: updated
Revision history for this message
Seyed Milad Hashemi (seyedmiladhashemi) wrote :

I make mistake at HTTP request method!

Changed in keystone:
assignee: nobody → Seyed Milad Hashemi (seyedmiladhashemi)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.