Skip to content

Commit 3849131

Browse files
committed
msauth: drop the obsolete string-userName extension method
`MicrosoftAuthenticationExtensions` existed only to keep in-tree callers of the pre-pivot `string userName` overload of `GetTokenForUserAsync` building during migration. The single production caller (the Azure Repos OAuth path) migrated to the `IMicrosoftAccount`-shaped interface method in the preceding commit, so the extension has no remaining in-tree callers. Delete the class. The interface is now the single shape callers talk to, with no parallel API to drift against. Assisted-by: Claude Opus 4.7
1 parent 19cbfa6 commit 3849131

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

src/shared/Core/Authentication/MicrosoftAuthentication.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -155,25 +155,6 @@ public override int GetHashCode()
155155
}
156156
}
157157

158-
public static class MicrosoftAuthenticationExtensions
159-
{
160-
/// <summary>
161-
/// Convenience overload of <see cref="IMicrosoftAuthentication.GetTokenForUserAsync"/>
162-
/// that takes a bare UPN string.
163-
/// </summary>
164-
[Obsolete("Construct a MicrosoftAccount and call the IMicrosoftAccount overload directly.")]
165-
public static Task<IMicrosoftAuthenticationResult> GetTokenForUserAsync(
166-
this IMicrosoftAuthentication msAuth,
167-
string authority, string clientId, Uri redirectUri, string[] scopes, string userName, bool msaPt = false)
168-
{
169-
EnsureArgument.NotNull(msAuth, nameof(msAuth));
170-
IMicrosoftAccount account = string.IsNullOrWhiteSpace(userName)
171-
? null
172-
: new MicrosoftAccount(homeAccountId: null, userName: userName);
173-
return msAuth.GetTokenForUserAsync(authority, clientId, redirectUri, scopes, account, msaPt);
174-
}
175-
}
176-
177158
public class MicrosoftAuthentication : AuthenticationBase, IMicrosoftAuthentication
178159
{
179160
public static readonly string[] AuthorityIds =

0 commit comments

Comments
 (0)