Skip to content

2.2.4 Created admin token has no access #15564

Closed
@krukas

Description

@krukas

When you create a token for an admin user and have set the options (Admin Token Lifetime (hours)) to empty, you will get an access denied because the token immediately expires.

Preconditions

  1. Set the option Admin Token Lifetime (hours)) to empty.

Steps to reproduce

  1. Create admin token with /V1/integration/admin/token
  2. Do any other call with this token

Expected result

  1. get result back for given API call

Actual result

  1. Consumer is not authorized to access %resources

For keeping the empty feature that is wont expire, we need to add a check for the token TTL: https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Webapi/Model/Authorization/TokenUserContext.php#L135

If I have some time I will create a pull request for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions