简体   繁体   中英

IdentityServer3 - how to get partial identity in PreAuthenticateAsync?

Question is quite self-describing. There is method:

await this.owinContext.Environment.GetIdentityServerPartialLoginAsync();

But in PreAuthenticateAsync method it gets null result. As a way how to achieve partial identity I use redirect to one of my controllers and back, but is there better way?

As the method name implies, this hits before any authentication takes place, so it won't have any partial login to give you. You should rather make that call in PostAuthenticateAsync which will hit after any authentication step and where you can create context.AuthenticateResult using an appropriate constructor that will either give you a new partial redirect or full result.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM