oauth - Enrich ASP.Net bearer token format -



oauth - Enrich ASP.Net bearer token format -

i have setup asp.net webapi project back upwards of bearer token this:

var oauthserveroptions = new oauthauthorizationserveroptions { allowinsecurehttp = true, tokenendpointpath = new pathstring("/token"), accesstokenexpiretimespan = timespan.fromdays(1), provider = new simpleauthorizationserverprovider() }; var oauthbeareroptions = new oauthbearerauthenticationoptions(); app.useoauthauthorizationserver(oauthserveroptions); app.useoauthbearerauthentication(oauthbeareroptions);

when create request token endpoint have reply

{ "access_token":"gst9uwsuesiyhkezr94k4xwuzvnq", "token_type":"bearer", "expires_in":86399 }

is there way enrich token additional fields this?

{ "access_token":"gst9uwsuesiyhkezr94k4xwuzvnq", "token_type":"bearer", "expires_in":86399, "username":"user@mail.com" }

well here solution:

in class inherits oauthauthorizationserverprovider

public override async task tokenendpoint(oauthtokenendpointcontext context) { context.additionalresponseparameters.add("username", "user@mail.com"); homecoming task.fromresult<object>(null); }

asp.net-web-api oauth bearer-token

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -