c# - ASP.Net Identity 2.1 alpha SignInManager.GetVerifiedUserIdAsync invalid cast -


I am using ASP.NET MVC5, which is ASP.NET ID2 alpha in my project.

I have applied the User Manager to use a grid as the key for identification.

I am implementing two factor authentication when I try to get the user ID

  var userId = wait for the sign in manager. GetVerifiedUserIdAsync ();  

I get an error

  Invalid artist for 'System.Guid' from 'system.String'.  

Is this identity a bug with alpha releases or am I missing something? If I use a factor authentication then all are good I users are created in database, you can change user data etc.

Any suggestion would be appreciated. Thank you.

I have got the solution I have seen two methods while looking at the definition of SignInManager

  public virtual TKey ConvertIdFromString (string ID); Public Virtual String Converted Tostring (TKI ID);  

So I will override these two methods in the implementation of the sign in manager and everything will work.

  Public override GUID ConvertIdFromString (string ID) {if (string IsNullOrEmpty (ID)) Return Guid.Empty; Return the new GID (ID); } Public override string converting toaster (guide id) {if (id.Equals (Guid.Empty)) return string. Empty; Return id Toasting (); }  

Comments

Post a Comment

Popular posts from this blog

c# - Textbox not clickable but editable -

Matlab transpose a table vector -

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -