This commit is contained in:
CatAClock 2025-04-24 15:12:56 -07:00
parent 622309c698
commit ce1c02cd04
2 changed files with 23 additions and 2 deletions

View file

@ -28,6 +28,27 @@ export async function CreatePKCECodeChallenge(CodeVerifier) {
return CodeChallenge; return CodeChallenge;
} }
// Component 3/7
export async function CreatePAR() {
let WellKnown = await GetPDSWellKnown();
// Some verification mechanism with PAR
let PAREndpoint = WellKnown.pushed_authorization_request_endpoint;
// Token goes into the authorization endpoint
let AuthEndpoint = WellKnown.authorization_endpoint;
}
// Component 4/7
export async function ClientDPoP() {
let KeyPair = await crypto.subtle.generateKey({name: "ECDSA", namedCurve: "P-256"}, true, ["sign", "verify"]);
console.log(KeyPair);
}
export async function ServerDPoP() {
}
// Stolen from elsewhere. // Stolen from elsewhere.
// Firefox snippet; Slightly edited. // Firefox snippet; Slightly edited.
async function sha256(message) { async function sha256(message) {

View file

@ -13,7 +13,7 @@ let MastodonClientSecret = "mastodon_client_secret";
let MastodonAccessToken = "mastodon_access_token"; let MastodonAccessToken = "mastodon_access_token";
let MastodonTokenType = "mastodon_access_token"; let MastodonTokenType = "mastodon_access_token";
// Bluesky // Bluesky (TODO: use these variables).
let BlueskyApp = "https://bsky.app"; let BlueskyApp = "https://bsky.app";
let BlueskyPDS = "https://bsky.social"; let BlueskyPDS = "https://bsky.social";
@ -94,4 +94,4 @@ function getRandomArbitrary(min, max) {
// The next section is dedicated to testing. // The next section is dedicated to testing.
// WARNING: I don't know what I am doing. // WARNING: I don't know what I am doing.
BlueskyAPI.CreatePKCE(); BlueskyAPI.ClientDPoP();