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

Fix Azure Repos sign-in with Microsoft Accounts #148

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

mjcheetham
Copy link
Collaborator

Use the /organizations authority for MSA accounts with Azure DevOps/Repos. This is because we're using MSA pass-through, an internal Microsoft mechanism to support both MSA and 'work' (AAD) accounts with the same auth stacks.

You should be able to use /common, but this doens't work. At the same time we're using ADAL Obj-C on macOS rather than MSAL.NET like we do on Windows, and ADAL speaks to the "v1" AAD endpoints, which don't know the /organizations tenant 😢

For macOS we need to fudge the authority back to /common for MSA accounts.

The "correct" fix here is to move from MSA pass-through, us our own client ID (#47) and drop the ADAL Obj-C component and add UI on .NET Core for MSAL.NET... all these things would take a long time to do.

Fixes #143

@mjcheetham mjcheetham added host:azure-repos Specific to the Azure Repos (Azure DevOps, VSTS) host provider auth:microsoft Specific to Microsoft AAD/MSA authentication labels Jul 17, 2020
@dscho
Copy link
Collaborator

dscho commented Jul 17, 2020

/azp trigger GCM-PR

@azure-pipelines
Copy link

Command 'trigger' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@dscho
Copy link
Collaborator

dscho commented Jul 17, 2020

/azp run GCM-PR

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Use the /organizations authority for MSA accounts with Azure
DevOps/Repos. This is because we're using MSA pass-through, an internal
Microsoft mechanism to support both MSA and 'work' (AAD) accounts with
the same auth stacks.

You should be able to use /common, but this doesn't work. At the same
time we're using ADAL Obj-C on macOS rather than MSAL.NET like we do on
Windows, and ADAL speaks to the "v1" AAD endpoints, which don't know the
/organizations tenant :(

For macOS we need to fudge the authority _back_ to /common for MSA
accounts.
Copy link
Collaborator

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it on Windows, and it works! 🎉

@mjcheetham mjcheetham merged commit 2b944be into git-ecosystem:master Jul 17, 2020
@mjcheetham mjcheetham deleted the msafix branch July 17, 2020 14:03
@mjcheetham
Copy link
Collaborator Author

The PR build was in fact green, but GitHub Checks API and Azure Pipelines was not having a good day... 😢
https://dev.azure.com/mseng/AzureDevOps/_build/results?buildId=12622663&view=results

@mjcheetham mjcheetham mentioned this pull request Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth:microsoft Specific to Microsoft AAD/MSA authentication host:azure-repos Specific to the Azure Repos (Azure DevOps, VSTS) host provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot sign in with MSA against MSA AzDO org
4 participants