IdentityServer / IdentityServer3.AspNetIdentity

ASP.NET Identity support for Thinktecture IdentityServer3
Apache License 2.0
64 stars 51 forks source link

Get ClientId in GetClaimsFromAccount #43

Closed totpero closed 9 years ago

totpero commented 9 years ago

Hello, I try to get ClientId when i override protected override async Task<IEnumerable<Claim>> GetClaimsFromAccount(User user) because i want to filter claims from database by ClientId. How i can do this? I try to do this:

....
       public string ClientId { get; set; }

        public override Task<AuthenticateResult> PreAuthenticateAsync(SignInMessage message)
        {
            if (message != null) ClientId = message.ClientId;
            return base.PreAuthenticateAsync(message);
        }
....

and in GetClaimsFromAccount i try this:

protected override async Task<IEnumerable<Claim>> GetClaimsFromAccount(User user)
{
...
 if (ClientId != null)  // do something ;
...
}

but `ClientId`  in `GetClaimsFromAccount` is always null.
 how i can solve my problem?
brockallen commented 9 years ago

Dup of: https://github.com/IdentityServer/IdentityServer3/issues/1514