OAuthUtility | Generate Authorization Headers with ease | OAuth 1.0 (v2)

OAuthUtility

:books: GitHub Repository | :scroll: Documentation | :package: Roblox Releases

OAuthUtility is a module to help you create OAuth headers for your HTTP requests. (What is OAuth?) Roblox currently provides no way to sign HTTP Requests using OAuth, despite the mass use throughout the internet, leaving Roblox developers who need to communicate with servers under-equipped. This module will hopefully fill this gap, allowing developers to safely and easily use OAuth 1.0 with accuracy and efficiency.

A long time ago, I attempted to use a platform for a pet project with my school’s API and wanted to write some code in Luau, yet I realized it required OAuth 1.0. This led me down the OAuth 1.0 rabbit hole, and here we are today.

With full implementation of HMAC-SHA1, HMAC-SHA256, and HMAC-SHA512, it’s better than ever, including unit tests and speedy optimization.

OAuthUtility is currently under an MIT License, meaning it is free to use.

Credit

OAuthUtility utilizes @metatablecatmaid’s Base64 module, along with Egor Skriptunoff’s SHA module for hashing.

Final Notes

OAuthUtility was just rewritten entirely to support more signature methods, so any usage of the past module is extremely unrecommended due to instability with parameter sorting and general unreliability.

If you have any questions or concerns, feel free to contact me on Discord (which is the same as my Roblox username). If you’d like to contribute to the project, feel free to make a fork or Pull Request.

5 Likes

Hey! Thanks for making this resource. I have a question about one of the limitations:

Based on observations, lots of people seem to be using OAuth 2.0 compared to the amount of people who use OAuth 1.0 given that OAuth 2.0 is the industry standard.

So have you considered that it would be better to add OAuth 2.0 support given that lots more people would find a use for this resource?

1 Like

Possibly. Currently a lot of major applications use OAuth 1.0. I’d be up to consider it in the future. I’ll do some research for you though. If it’s possible, I can definitely try.

1 Like

I have entirely re-writtten the module and have published a release to GitHub in luau, tested under the Luau Binary release by Roblox. It now includes signature methods for HMAC and SHA, and supports percent encoding.

I have also re-written the post to match said updates.

Releases include pure Luau and an RBXM model.

Enjoy.

1 Like