MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / appleAuthUrl

Function appleAuthUrl

webapp/_webapp/src/libs/oauth.ts:25–42  ·  view source on GitHub ↗
(state: string)

Source from the content-addressed store, hash-verified

23}
24
25export function appleAuthUrl(state: string) {
26 // const options: SignInWithAppleOptions = {
27 // clientId: 'dev.junyi.PaperDebugger', // Apple Client ID
28 // redirectURI: REDIRECT_URI,
29 // state: state,
30 // // responseMode: 'query',
31 // scopes: 'name'
32 // };
33 const url = new URL("https://appleid.apple.com/auth/authorize");
34 url.searchParams.set("redirect_uri", REDIRECT_URI);
35 url.searchParams.set("state", state);
36 url.searchParams.set("nonce", Math.random().toString(36).substring(2, 15)); // Recommended to add nonce
37 url.searchParams.set("scope", "name email");
38 url.searchParams.set("response_mode", "form_post"); // Or "form_post"
39 url.searchParams.set("client_id", "dev.junyi.PaperDebugger.si");
40 url.searchParams.set("response_type", "code id_token");
41 return url.toString();
42}
43
44/**
45 * Check if running in Office Add-in environment

Callers 1

getAppleAuthTokenFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected