oauth 2.0 - OAUth2 ASP.NET invalid_grant -
i trying implement oauth2 web application though signing in application works, refresh tokens result in http 400 "invalid_grant". specifically, project asp.net webapi owin oauth provider. has been killing me days without luck appreciated :)
have correctly set oauthauthorizationserveroptions.refreshtokenprovider
?
if need sample, katana's sandbox project contains minimal implementation showing how can configure protect , serialize refresh tokens using data protection block (machine keys on iis): https://github.com/jchannon/katanaproject/blob/master/tests/katana.sandbox.webserver/startup.cs#l169-l173
app.useoauthauthorizationserver(new oauthauthorizationserveroptions { refreshtokenprovider = new authenticationtokenprovider { oncreate = createrefreshtoken, onreceive = receiverefreshtoken, } }); private void createrefreshtoken(authenticationtokencreatecontext context) { context.settoken(context.serializeticket()); } private void receiverefreshtoken(authenticationtokenreceivecontext context) { context.deserializeticket(context.token); }
if still doesn't work, try enabling tracing determine root cause of invalid_grant
error: http://katanaproject.codeplex.com/wikipage?title=debugging&referringtitle=documentation
Comments
Post a Comment