...
Code Block | ||||
---|---|---|---|---|
| ||||
rule get_access_token {
select when oauth response
if(not authorized) then {
http:post(dropbox_base_url+"/oauth/request_token") with
body = {} and
headers = {"Authorization" : create_oauth_header_value(keys:dropbox('app_key'),
keys:dropbox('app_secret'))
} and
autoraise = "request_token"
}
} |
...
After the click, they'll see this dialog at Dropbox:
When the user clicks "Allow", Dropbox will GET the callback URL that we supplied. This will raise oauth:response
event to the current ruleset.
Getting the Access Token
Because we set the callback URL as an ESL that raises a oauth:response
event to the current ruleset, we need a rule that is selected on that event. The rule can use the access token endpoint to retrieve the token and its associated secret.
...