Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 782
Bill Avatar asked Oct 31 '22 10:10

Bill


1 Answers

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.

like image 105
Chris Pratt Avatar answered Nov 11 '22 15:11

Chris Pratt