Frage

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?

Keine korrekte Lösung

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top