-
-
Save rphsoftware/bc7a98428fe538131a584e33cfc6e243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; | |
const app = express(); | |
const base = "https://example.com"; // replace this with a URL you control and host this on | |
app.get("/.well-known/openid-configuration", (req, res) => { | |
res.json({ | |
issuer: "your mom", | |
authorization_endpoint: base + "/auth", | |
token_endpoint: base + "/token", | |
userinfo_endpoint: base + "/userinfo" | |
}); | |
}); | |
app.get("/auth", (req, res) => { | |
res.redirect(req.query.redirect_uri + "?code=1234&state=" + req.query.state); | |
}); | |
app.post("/token", (req, res) => { | |
res.json({ | |
access_token: "1234", | |
token_type: "Meow" | |
}); | |
}); | |
app.get("/userinfo", (req, res) => { | |
res.json({ | |
sub: "..flag" | |
}); | |
}); | |
app.listen(8033); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment