Skip to content

AbstractAcquireTokenParameterBuilder<T>.WithAdfsAuthority throws with a null TenantId when the authority host Uri ends in /adfs #4860

@christothes

Description

@christothes

Azure.Identity recently changed from calling the deprecated:

AbstractAcquireTokenParameterBuilder<T>.WithAuthority(AuthorityHost.AbsoluteUri, tenantId);

to this:

UriBuilder uriBuilder = new UriBuilder(AuthorityHost)
{
    Path = tenantId
};
builder.WithTenantIdFromAuthority(uriBuilder.Uri);

When adfs is passed as the tenantId, WithTenantIdFromAuthority throws because tenantId is null.

I looked at the MSAL code and this is the reason we end up with a null TenantId

This creates an AdfsAuthority which hard codes null as the TenantId

Ideally WithTenantIdFromAuthority should handle the ADFS case and do the same thing as WithAuthority(AuthorityHost.AbsoluteUri, tenantId) does.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions