Question

According to some posts i decided to try out the binding of the users by custom user id, no the IPrincipal.Identity.Name.

So I've implemented:

public class CustomUserIdProvider : IUserIdProvider
{
    public string GetUserId(IRequest request)
    {
        var identity = (ClaimsPrincipal)Thread.CurrentPrincipal;
        string id = identity.Claims.Where(c => c.Type == UserInfoIdClaimType)
                                   .Select(c => c.Value).Single();
        return id;
    }
}

But when this method is called, there are no claims in the identity ...

So i can't retrieve on this moment the claims from there?

Or maybe i should do it differently?

No correct solution

OTHER TIPS

Solved issue, it seems that i haven't registered OWIN auth correctly when i did it in web config, it worked!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top