Avoid ServiceStack creating multiple UserAuth with the same email address -


How can I not create multiple user names with the same email address in the service stack?

I do the following:

  • Create an account using credentials (user + pass) & amp; Log in
  • Log in
  • Sign in using Facebook (The email address used in the credentials)

This is a new UserAuth And therefore the new user Is it possible to tell the user who is trying to sign in to use Facebook that an account with an email address already exists?

I looked at the FacebookAuthProvider subclassing and override the authentication but I do not have access to email yet there is another way from Facebook that I need to override? A similar question is here, but is not it the solution?

Service stacks now confirm e-mail returned by OAuth providers , Where now a userAuth with an existing email authentication is already unsuccessful and with error message token (HTML / for web browser requests) is redirected:

  / otherwise if they already have a If authenticated with existing email, then Facebook authentication will be successful and user accounts will be merged together 

A new CustomValidationFilter was also added to all AuthProviders, which can be used to return a IHttpResult For example:

  Plugins.Add (new AuthFeature (() => New CustomUserSession (), New IAuthProvider [] {New FacebookAuthProvider (App Settings) {CustomValidationFilter = authCtx = & gt; ; Custom authCtx? AuthCtx.Service.Redirect (authCtx.Session.ReferrerUrl .AddHashParam ("f", "CustomErrorCode")): faucet,},}));  

This change will now be available from v4.0.25 + .


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -