Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neil-sabol/3ceab9221500261bbda76e0893b8734e to your computer and use it in GitHub Desktop.
Save neil-sabol/3ceab9221500261bbda76e0893b8734e to your computer and use it in GitHub Desktop.
See https://blog.neilsabol.site/post/onetimesecret-api-powershell-cli-basic-example-one-time-secret/ . This snippet uses Invoke-RestMethod and the OneTimeSecret API to generate a random password then output the password and secret link to retrieve it.
@sergeevabc
Copy link

And where is the message itself, which should be sent to the server?

@neil-sabol
Copy link
Author

Hello Aleksandr - good question. Speaking candidly, this gist is unfortunately not aligned with "...create solutions for the masses, not just sloppy code to brag..."

It aims to address a very specific use case/workflow and eliminate clicks.

It generates and stores a random secret on the Onetimesecret service, then returns the secret (and a Onetimesecret link to it) to the console of the user executing the snippet. Then (as an example), the executor would reset an account password in some system (to the random, generated secret) and provide the Onetimesecret link to the account's owner so they could retrieve it, login, and reset the account password to something they want.

In my case, it saves the clicks of generating a random password (via a separate tool or script), opening a browser, and creating a Onetimesecret link for the password.

@sergeevabc
Copy link

I see, Neil, thank you for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment