authentication - c# webapi refresh_token don't delete when authenticating -
i have been following article, explaining how add token authentication application. have 3rd party wishes connect me , have set refresh tokens, etc. problem is, when authenticate token have given them, new refresh_token generated.
i know design, wish turn off.
currently, recieve method looks this:
public async task receiveasync(authenticationtokenreceivecontext context) { // our allowed origin var allowedorigin = context.owincontext.get<string>("as:clientallowedorigin"); // add our allowed origin our headers context.owincontext.response.headers.add("access-control-allow-origin", new[] { allowedorigin }); // our hashed token var hashedtokenid = _helper.encrypt(context.token); // our refresh token var refreshtoken = await _service.getasync(hashedtokenid); // if have refresh token if (refreshtoken != null) { // ticket context.deserializeticket(refreshtoken.protectedticket); // remove ticket await deleteasync(hashedtokenid); // save our changes await _service.savechangesasync(); } }
the order of execution seems be
validateclientauthentication > receiveasync > grantrefreshtoken > createasync
i seem have no control on execution path. so, change code refresh token not created when using grant_type: refresh_token
. know how can , also, affect security?
Comments
Post a Comment