diff --git a/Functions/Get-DBToken.md b/Functions/Get-DBToken.md new file mode 100644 index 0000000..fb8037e --- /dev/null +++ b/Functions/Get-DBToken.md @@ -0,0 +1,90 @@ +

+ +

+ + +
+ Table of Contents +
    +
  1. Description
  2. +
  3. The Function
  4. +
  5. Examples
  6. +
  7. Contact
  8. +
  9. Acknowledgments
  10. +
+
+ +# Get-DBToken + +## Description + +Obtains a fresh Authtoken, prevents Authtoken timeouts after 4h. + +## The Function + +### [GET-DBToken] + +After retreiving a Refreshtoken you could use this function to obtain a fresh Authtoken for the Dropbox Upload function. +This solve the problem of timing out after 4 hours. + +Use e.g. $DBToken=Get-DBToken and use $DBToken instead of your token. + +``` +function Get-DBToken { + $headersDB = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" + $headersDB.Add("grant_type", "refresh_token") + $headersDB.Add("refresh_token", "INSERT YOUR REFRESH TOKEN HERE") + $headersDB.Add("client_id", "YOUR_APP_KEY") + $headersDB.Add("client_secret", "YOUR_APP_SECRET") + + $BodyDB = @{ + grant_type = "refresh_token" + refresh_token = "INSERT YOUR REFRESH TOKEN HERE" + client_id = "YOUR_APP_KEY" + client_secret = "YOUR_APP_SECRET" + + } +Invoke-RestMethod -Uri https://www.dropbox.com/oauth2/token -Method Post -Headers $headersDB -Body $BodyDB +} +``` +

(back to top)

+ + +## Examples +[//]: # (Examples of scripts that have used your function) +Listed below are payloads that have used one of these functions: + + + + +

(back to top)

+ + +## Contact + +HackingMark +


+ + + + + + + + + +

+ + + +

(back to top)

+ + +## Acknowledgments + + +*** + +[HOME-PAGE](https://github.com/I-Am-Jakoby/PowerShell-for-Hackers) + +

(back to top)