microsoft / azure-devops-python-api

Azure DevOps Python API
https://docs.microsoft.com/azure/devops/integrate/index?view=azure-devops
MIT License
573 stars 197 forks source link

Authentication through Personal Access Token creates organisational coupling #500

Open IncandescentChrysalis opened 3 months ago

IncandescentChrysalis commented 3 months ago

Currently, the only documented way to use this library is to authenticate with a Personal Access Token.

This seems wrong, as:

Is there a plan to support other kinds of authentication scheme with Azure DevOps (Server)?

One could think of an OAuth2 process, for instance, allowing different flows:

Both flow isolate authentication of the application from any other organisational resource, and allow delegation of authorisation and grants lifecycle to a dedicated, potentially automated third-party.

JohnStokes228 commented 1 month ago

i would like to add that all other azure sdks im aware of are using azure-identity for auth, can this please be updated to do the same?

https://github.com/Azure/azure-sdk-for-python/issues/36643

vs4vijay commented 2 weeks ago

Yes, We need support for azure identity SDK in Azure DevOps SDK. This is what I am doing currently as workaround, but this doesn't cater for refreshing the access token, and other related use cases.

credential = DefaultAzureCredential()
token = credential.get_token("499b84ac-1321-427f-aa17-267ca6975798/.default")
credential2 = BasicTokenAuthentication({"access_token": token.token})

CC: @nechvatalp, @tonybaloney