rest - Is there a standard way to generate a RESTful access token? -


i touch restful api. basically, no matter rest api is, first step access token. however, have been in 2 different situations:

  1. have client_id, client_secret, , username, password.

    post: api.xx.com/1/authorize?       authorization:basic [client_id:client_secret] must base 64 encoded       content-type: application/json 

    then, access token without timeout.

  2. have app_key

    get https://api.xx.com/authorize?     response_type=pin&     client_id=app_key&     scope=scope 

    after pin, register in web application. use code request access token.

    post https://api.xx.com/token?     grant_type=pin&     code=authorization_token&     client_id=app_key 

finally, have access token , reflesh token. access token timeout after 1hr. need use refresh token application access again.

i want say, restful doesn't have standard, access token application methods big different. think first 1 better. first 1 makes things simple.

because start call restful web services, ask: these 2 authorization methods common way? there third method access token? comments please. thanks.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -