Skip to content

User Claims missing from Identity Endpoints breaks Authorization #52142

Closed as not planned
Closed as not planned
@augustevn

Description

@augustevn

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I did some digging, it seems like the user Claims are no longer returned from /manage/info from the .MapIdentityApi<User>().

My custom authorization was depending on getting those claims.
This change broke my app, worked in RC2 not in RTM. Or is this intentional?

IdentityApiEndpointRouteBuilderExtensions.cs, line 455:


    private static async Task<InfoResponse> CreateInfoResponseAsync<TUser>(TUser user, UserManager<TUser> userManager)
        where TUser : class
    {
        return new()
        {
            Email = await userManager.GetEmailAsync(user) ?? throw new NotSupportedException("Users must have an email."),
            IsEmailConfirmed = await userManager.IsEmailConfirmedAsync(user),
        };
    }

Expected Behavior

Return the user's Claims on authenticated GET call to /manage/info on the Identity Endpoints.

Steps To Reproduce

Upgrade from .NET 8 RC2 to .NET 8 RTM, implement the .MapIdentityApi<User>(), spot the 7 differences.

Exceptions (if any)

/

.NET Version

8.0.100

Anything else?

Possibly related to Blazor Identity UI issues: #52063
Of which it likely affects authorization.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions