From fd722ac48ee325d8eaf1bc7d8df65323ba2d426c Mon Sep 17 00:00:00 2001 From: JuLi0n21 Date: Wed, 10 Jan 2024 04:24:58 +0100 Subject: [PATCH] add Readme --- README.md | 23 +++++++++++++++++++++++ server.js | 2 -- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a7bd2ce --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Osu Oauth Middleware Server hosted on Vercel +Route access token back to end user without them needing own Api credentials! + +# How to use: +1. Fork Repo +2. Deploy on Vercel +3. Create [Api Client](https://osu.ppy.sh/home/account/edit#oauth) use the Vercel Domain as Callback +4. add Envoirment variables +- SCOPE: [scopes](https://osu.ppy.sh/docs/index.html#scopes) +- CALLBACK_URL: localy hosted endpoint to where the access_token should be send to +- URL: vercel Domain +- PORT: Vercel server Port / default is 9000 +- CLIENT_ID: client_id +- CLIENT_SECRET: client_secret + +5. Add link to the vercel domain with port as state to /authoritze: +https://example.vercel.app/authorize?port=4200 + +6. recieive anser at: +https://localhost:4200/{CALLBACK_URL}?access_token={access_token}&refresh_token={refresh_token}&expires_in={expires_in} +7. profit? + +## use at own risk, security holes might be in there \ No newline at end of file diff --git a/server.js b/server.js index cc3ff9e..b203602 100644 --- a/server.js +++ b/server.js @@ -4,8 +4,6 @@ const app = express(); const port = process.env.PORT || 9000; -let tokenData; - app.use((req, res, next) => { console.log(`[${new Date().toLocaleString()}] ${req.method} ${req.url}`); next();