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:
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.
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
Post a Comment