asp.net mvc - UserManager VerifyUserTokenAsync Always False -
i'm generating usertoken so
public async task generatecode() { var code = await usermanager.generateusertokenasync("heymega", new guid("16139fcd-7ae0-449c-ad1c-f568bbe46744")); }
i pass same token action via separate request
public async task validatecode(string code) { var valid = await usermanager.verifyusertokenasync(new guid("16139fcd-7ae0-449c-ad1c-f568bbe46744"), "heymega", code); //returns false }
however, response verifyusertokenasync
method false.
if generate code , verify within same action
public async task generatecode() { var code = await usermanager.generateusertokenasync("heymega", new guid("16139fcd-7ae0-449c-ad1c-f568bbe46744")); var valid = await usermanager.verifyusertokenasync(new guid("16139fcd-7ae0-449c-ad1c-f568bbe46744"), "heymega", code); //returns true }
it returns true.
why can't verify method verify code in separate request? missing obvious?
i figured after pulling hair out hours. need url encode code , decided use httputility class this.
httputility.urlencode(code);
when comes verifying code, do not need url decode code.
Comments
Post a Comment