javascript - OAuth: Is it ok to return access token as json? -
when return request token (i server), send values in body of response:
oauth_token=946ccd316c&oauth_token_secret=395cfee8ca&oauth_callback_confirmed=true i trying figure out if it'd possible dance on jsonp. signing , requesting works fine, body isn't json, response fails during parsing.
so, reply body coded jsonp insted (if client requested it), this:
callback({oauth_token:'946ccd316c',oauth_token_secret:'395cfee8ca',oauth_callback_confirmed:true}) and work. questions are:
would break standards? allowed change encoding of body? there better way?
oauth specification doesn't specify format sending token. think return inside json object have shown.
in fact google returns access_token inside json object shown below:
response :{ "access_token" : "ya29s6zqbibqpa5rz8oty00xj-xydfdfddteerer-1em", "token_type" : "bearer", "expires_in" : 3600 }
Comments
Post a Comment