.net - Getting UserIdentity returns the old identity -
in mvc have custom authorizeattribute. inside attribute sign in useridentity cookie authentication. in claims have refresh token changed in each request api know.
request.getowincontext().authentication.signin(authproperties, identity);
so after login i'm signed in specific refresh token claim(for example 'xxxxx'). access 1 of actions has customauthorizeattribute. in customauthorizeattribute above code executed. i'm signed in new identity , new refresh token claim("yyyyyy"). when try claim in action refresh token old 1 ("xxxxxx").
[customauthorize] public actionresult edituser() { var useridentity = this.user.identity claimsidentity; //here old 1 token var refreshtoken = useridentity.claims.firstordefault(s => s.type == "refreshtoken").value; return view("edituser"); }
any ideas how latest token claims. other workaround save in session guess.
Comments
Post a Comment