Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks
godev99 opened this issue Nov 22, 2024 · 0 comments
Open
4 tasks

Comments

@godev99
Copy link

godev99 commented Nov 22, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant