简体   繁体   中英

asp.net identity using Owin with Google login: skip registration

I am using ASP.NET Identity so I can integrate Google login via OWIN in an MVC website using EF. once the login on Google completes, there is a registration page. I want to not have that page, but I'm having trouble figuring out how (or if it is possible) to accept the email provided by Google and skip the registration step.

Do you have a suggestion?

I really feel like I'm missing the point and that I should try to understand the purpose of the registration step better.

This is just the default path the Identity template uses. You can customize the flow to your heart's content. After authenticating with the third-party, the user is redirected to your ExternalLoginCallback method in AccountController . The default behavior of this action is to present a form to the user to collection additional profile information. Upon the user submitting this form, the data is posted to ExternalLoginConfirm , which actually creates the account.

The rationale for this approach is two-fold: 1) it gives the user the opportunity to verify the data pulled from the third-party provider and explicitly create their account and 2) it follows REST, which conditions that GET requests (which the callback will be) should not be atomic.

However, there's nothing stopping you from just moving the account creation logic into the callback action and stopping there.

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