Skip to content

[Question]: getTokenUsingBasicAuth with different header than Authorization #20686

Open
@godev99

Description

Task name

No response

Task version

No response

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

none

Question

I'm trying to use getTokenUsingBasicAuth with a custom service endpoint (get from https://github.com/Microsoft/azure-pipelines-tasks/issues/7263)

...
"authenticationSchemes": [
  {
    "type": "ms.vss-endpoint.endpoint-auth-scheme-basic",
    "headers": [
        {
            "name": "x-redlock-auth",
            "value": "{{ #getTokenUsingBasicAuth { 'username': 'endpoint.username', 'password': 'endpoint.password', 'resultSelector': 'jsonpath:$.token', 'method': 'post', 'authServerUrl': 'endpoint.url/login', 'body': {'username': 'endpoint.username', 'password': 'endpoint.password'} } }}"
        }
    ]
  }
]  
...

"dataSources": [
  {
    "name": "ListUsers",
    "endpointUrl": "{{{endpoint.Url}}}/v3/user",
    "requestVerb": "Get"
  }
]

..
My request failed :
"message":"request has different values in X-Redlock-Auth and Authorization, unclear which to use."

Endpoint is waiting for X-Redlock-Auth only, not Authorization or both.

Help would be very much appreciated.

Thanks.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions