@authrim/sveltekit 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +31 -1
- package/dist/oauth/index.d.ts +41 -0
- package/dist/oauth/index.d.ts.map +1 -0
- package/dist/oauth/index.js +196 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/client-config.d.ts +32 -0
- package/dist/utils/client-config.d.ts.map +1 -0
- package/dist/utils/client-config.js +42 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/package.json +4 -2
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/lib/client.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/lib/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EAiBd,MAAM,YAAY,CAAC;AAqEpB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,aAAa,CAAC,CAwdxB"}
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Authrim Svelte SDK Main Entry Point
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { createAuthrimClient } from "@authrim/core";
|
|
5
|
+
import { authResultToResponse, wrapWithAuthResponse, success, fetchClientConfig, } from "./utils/index.js";
|
|
5
6
|
import { PasskeyAuthImpl } from "./direct-auth/passkey.js";
|
|
6
7
|
import { EmailCodeAuthImpl } from "./direct-auth/email-code.js";
|
|
7
8
|
import { SocialAuthImpl } from "./direct-auth/social.js";
|
|
@@ -10,6 +11,7 @@ import { ConsentApiImpl } from "./direct-auth/consent.js";
|
|
|
10
11
|
import { DeviceFlowApiImpl } from "./direct-auth/device-flow.js";
|
|
11
12
|
import { CIBAApiImpl } from "./direct-auth/ciba.js";
|
|
12
13
|
import { LoginChallengeApiImpl } from "./direct-auth/login-challenge.js";
|
|
14
|
+
import { createOAuthNamespace } from "./oauth/index.js";
|
|
13
15
|
import { BrowserHttpClient } from "./providers/http.js";
|
|
14
16
|
import { BrowserCryptoProvider } from "./providers/crypto.js";
|
|
15
17
|
import { createBrowserStorage, } from "./providers/storage.js";
|
|
@@ -73,6 +75,33 @@ export async function createAuthrim(config) {
|
|
|
73
75
|
const emitter = new AuthEventEmitter();
|
|
74
76
|
// Initialize stores
|
|
75
77
|
const internalStores = createAuthStores();
|
|
78
|
+
// ==========================================================================
|
|
79
|
+
// OAuth (Optional)
|
|
80
|
+
// ==========================================================================
|
|
81
|
+
let oauth;
|
|
82
|
+
if (config.enableOAuth) {
|
|
83
|
+
// Fetch public client configuration from server
|
|
84
|
+
const clientConfig = await fetchClientConfig(config.issuer, config.clientId);
|
|
85
|
+
if (clientConfig) {
|
|
86
|
+
console.debug('[Authrim] Client configuration loaded:', {
|
|
87
|
+
client_id: clientConfig.client_id,
|
|
88
|
+
client_name: clientConfig.client_name,
|
|
89
|
+
login_ui_url: clientConfig.login_ui_url,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Create core client for OAuth flows
|
|
93
|
+
const coreClient = await createAuthrimClient({
|
|
94
|
+
issuer: config.issuer,
|
|
95
|
+
clientId: config.clientId,
|
|
96
|
+
http,
|
|
97
|
+
crypto,
|
|
98
|
+
storage,
|
|
99
|
+
});
|
|
100
|
+
// Create OAuth namespace
|
|
101
|
+
oauth = createOAuthNamespace(coreClient, {
|
|
102
|
+
silentLoginRedirectUri: config.silentLoginRedirectUri,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
76
105
|
// Create session manager
|
|
77
106
|
const sessionManager = new SessionAuthImpl({
|
|
78
107
|
issuer: config.issuer,
|
|
@@ -391,6 +420,7 @@ export async function createAuthrim(config) {
|
|
|
391
420
|
emailCode,
|
|
392
421
|
social,
|
|
393
422
|
session,
|
|
423
|
+
oauth,
|
|
394
424
|
consent,
|
|
395
425
|
deviceFlow,
|
|
396
426
|
ciba,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth Namespace for SvelteKit
|
|
3
|
+
*
|
|
4
|
+
* Provides OAuth 2.0 / OpenID Connect authentication flows
|
|
5
|
+
*/
|
|
6
|
+
import type { AuthrimClient as CoreClient } from "@authrim/core";
|
|
7
|
+
import type { TrySilentLoginOptions, SilentLoginResult } from "../types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Create OAuth namespace
|
|
10
|
+
*/
|
|
11
|
+
export declare function createOAuthNamespace(coreClient: CoreClient, config: {
|
|
12
|
+
silentLoginRedirectUri?: string;
|
|
13
|
+
}): {
|
|
14
|
+
/**
|
|
15
|
+
* Try silent SSO via top-level navigation (prompt=none)
|
|
16
|
+
*
|
|
17
|
+
* Safari ITP / Chrome Third-Party Cookie Phaseout compatible.
|
|
18
|
+
* This function redirects to IdP and does not return.
|
|
19
|
+
*
|
|
20
|
+
* @param options - Silent login options
|
|
21
|
+
* @throws Error if returnTo URL is not same origin
|
|
22
|
+
*/
|
|
23
|
+
trySilentLogin(options?: TrySilentLoginOptions): Promise<never>;
|
|
24
|
+
/**
|
|
25
|
+
* Handle silent login callback
|
|
26
|
+
*
|
|
27
|
+
* Call this in your callback page. Handles both silent login
|
|
28
|
+
* results and regular OAuth callbacks.
|
|
29
|
+
*
|
|
30
|
+
* @returns Silent login result
|
|
31
|
+
*/
|
|
32
|
+
handleSilentCallback(): Promise<SilentLoginResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Handle regular OAuth callback (for authorization code flow)
|
|
35
|
+
*
|
|
36
|
+
* @param callbackUrl - Full callback URL with code and state
|
|
37
|
+
* @returns Tokens from token exchange
|
|
38
|
+
*/
|
|
39
|
+
handleCallback(callbackUrl?: string): Promise<import("@authrim/core").TokenSet>;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/oauth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAc5E;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE;IACN,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;IAGC;;;;;;;;OAQG;6BAC4B,qBAAqB,GAAG,OAAO,CAAC,KAAK,CAAC;IA2CrE;;;;;;;OAOG;4BAC2B,OAAO,CAAC,iBAAiB,CAAC;IA0HxD;;;;;OAKG;iCACgC,MAAM;EAK5C"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth Namespace for SvelteKit
|
|
3
|
+
*
|
|
4
|
+
* Provides OAuth 2.0 / OpenID Connect authentication flows
|
|
5
|
+
*/
|
|
6
|
+
import { stringToBase64url, base64urlToString } from "@authrim/core";
|
|
7
|
+
/**
|
|
8
|
+
* Create OAuth namespace
|
|
9
|
+
*/
|
|
10
|
+
export function createOAuthNamespace(coreClient, config) {
|
|
11
|
+
return {
|
|
12
|
+
/**
|
|
13
|
+
* Try silent SSO via top-level navigation (prompt=none)
|
|
14
|
+
*
|
|
15
|
+
* Safari ITP / Chrome Third-Party Cookie Phaseout compatible.
|
|
16
|
+
* This function redirects to IdP and does not return.
|
|
17
|
+
*
|
|
18
|
+
* @param options - Silent login options
|
|
19
|
+
* @throws Error if returnTo URL is not same origin
|
|
20
|
+
*/
|
|
21
|
+
async trySilentLogin(options) {
|
|
22
|
+
// Browser-only feature
|
|
23
|
+
if (typeof window === "undefined") {
|
|
24
|
+
throw new Error("trySilentLogin is only available in browser");
|
|
25
|
+
}
|
|
26
|
+
const onLoginRequired = options?.onLoginRequired ?? "return";
|
|
27
|
+
const returnTo = options?.returnTo ?? window.location.href;
|
|
28
|
+
// Security: Open redirect prevention
|
|
29
|
+
if (!isSafeReturnTo(returnTo)) {
|
|
30
|
+
throw new Error("returnTo must be same origin");
|
|
31
|
+
}
|
|
32
|
+
// Encode state data (short keys to reduce URL length)
|
|
33
|
+
const stateData = {
|
|
34
|
+
t: "sl", // silent_login
|
|
35
|
+
lr: onLoginRequired === "login" ? "l" : "r",
|
|
36
|
+
rt: returnTo,
|
|
37
|
+
};
|
|
38
|
+
const state = stringToBase64url(JSON.stringify(stateData));
|
|
39
|
+
// Build authorization URL with prompt=none
|
|
40
|
+
const result = await coreClient.buildAuthorizationUrl({
|
|
41
|
+
redirectUri: config.silentLoginRedirectUri ??
|
|
42
|
+
`${window.location.origin}/callback.html`,
|
|
43
|
+
scope: options?.scope,
|
|
44
|
+
prompt: "none",
|
|
45
|
+
exposeState: false, // We manage state ourselves
|
|
46
|
+
});
|
|
47
|
+
// Append our custom state to the URL
|
|
48
|
+
const url = new URL(result.url);
|
|
49
|
+
url.searchParams.set("state", state);
|
|
50
|
+
// Redirect (this function never returns)
|
|
51
|
+
window.location.href = url.toString();
|
|
52
|
+
// TypeScript: This line is never reached
|
|
53
|
+
throw new Error("unreachable");
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* Handle silent login callback
|
|
57
|
+
*
|
|
58
|
+
* Call this in your callback page. Handles both silent login
|
|
59
|
+
* results and regular OAuth callbacks.
|
|
60
|
+
*
|
|
61
|
+
* @returns Silent login result
|
|
62
|
+
*/
|
|
63
|
+
async handleSilentCallback() {
|
|
64
|
+
// Browser-only feature
|
|
65
|
+
if (typeof window === "undefined") {
|
|
66
|
+
return { status: "error", error: "not_browser" };
|
|
67
|
+
}
|
|
68
|
+
const params = new URLSearchParams(window.location.search);
|
|
69
|
+
const error = params.get("error");
|
|
70
|
+
const stateParam = params.get("state");
|
|
71
|
+
// Try to decode state
|
|
72
|
+
let stateData = null;
|
|
73
|
+
if (stateParam) {
|
|
74
|
+
try {
|
|
75
|
+
const decoded = base64urlToString(stateParam);
|
|
76
|
+
const parsed = JSON.parse(decoded);
|
|
77
|
+
// Type guard: check if this is a silent login state
|
|
78
|
+
if (parsed.t === "sl" &&
|
|
79
|
+
typeof parsed.lr === "string" &&
|
|
80
|
+
typeof parsed.rt === "string") {
|
|
81
|
+
stateData = {
|
|
82
|
+
t: "sl",
|
|
83
|
+
lr: parsed.lr,
|
|
84
|
+
rt: parsed.rt,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// Decode failed, not a silent login state
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// Not a silent login callback
|
|
93
|
+
if (!stateData) {
|
|
94
|
+
// Return error to indicate this is not a silent login callback
|
|
95
|
+
return { status: "error", error: "not_silent_login" };
|
|
96
|
+
}
|
|
97
|
+
const returnTo = stateData.rt;
|
|
98
|
+
const onLoginRequired = stateData.lr === "l" ? "login" : "return";
|
|
99
|
+
// Security: Open redirect prevention
|
|
100
|
+
if (!isSafeReturnTo(returnTo)) {
|
|
101
|
+
return { status: "error", error: "invalid_return_to" };
|
|
102
|
+
}
|
|
103
|
+
// Handle login_required error (IdP has no session)
|
|
104
|
+
if (error === "login_required") {
|
|
105
|
+
if (onLoginRequired === "login") {
|
|
106
|
+
// Redirect to login screen (without prompt=none)
|
|
107
|
+
const loginResult = await coreClient.buildAuthorizationUrl({
|
|
108
|
+
redirectUri: config.silentLoginRedirectUri ??
|
|
109
|
+
`${window.location.origin}/callback.html`,
|
|
110
|
+
exposeState: false,
|
|
111
|
+
});
|
|
112
|
+
// Encode return URL in state for after login
|
|
113
|
+
const loginStateData = { rt: returnTo };
|
|
114
|
+
const loginUrl = new URL(loginResult.url);
|
|
115
|
+
loginUrl.searchParams.set("state", stringToBase64url(JSON.stringify(loginStateData)));
|
|
116
|
+
window.location.href = loginUrl.toString();
|
|
117
|
+
return { status: "login_required" };
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
// Return to original page with error
|
|
121
|
+
const returnUrl = new URL(returnTo);
|
|
122
|
+
returnUrl.searchParams.set("sso_error", "login_required");
|
|
123
|
+
window.location.href = returnUrl.toString();
|
|
124
|
+
return { status: "login_required" };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Handle other errors
|
|
128
|
+
if (error) {
|
|
129
|
+
const errorDescription = params.get("error_description");
|
|
130
|
+
const returnUrl = new URL(returnTo);
|
|
131
|
+
returnUrl.searchParams.set("sso_error", error);
|
|
132
|
+
if (errorDescription) {
|
|
133
|
+
returnUrl.searchParams.set("sso_error_description", errorDescription);
|
|
134
|
+
}
|
|
135
|
+
window.location.href = returnUrl.toString();
|
|
136
|
+
return {
|
|
137
|
+
status: "error",
|
|
138
|
+
error,
|
|
139
|
+
errorDescription: errorDescription ?? undefined,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// Success: Exchange code for tokens
|
|
143
|
+
const code = params.get("code");
|
|
144
|
+
if (code) {
|
|
145
|
+
try {
|
|
146
|
+
await coreClient.handleCallback(window.location.href);
|
|
147
|
+
// Clear sso_attempted flag on success
|
|
148
|
+
if (typeof sessionStorage !== "undefined") {
|
|
149
|
+
sessionStorage.removeItem("sso_attempted");
|
|
150
|
+
}
|
|
151
|
+
window.location.href = returnTo;
|
|
152
|
+
return { status: "success" };
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
const errorMessage = e instanceof Error ? e.message : "Token exchange failed";
|
|
156
|
+
const returnUrl = new URL(returnTo);
|
|
157
|
+
returnUrl.searchParams.set("sso_error", "token_error");
|
|
158
|
+
returnUrl.searchParams.set("sso_error_description", errorMessage);
|
|
159
|
+
window.location.href = returnUrl.toString();
|
|
160
|
+
return {
|
|
161
|
+
status: "error",
|
|
162
|
+
error: "token_error",
|
|
163
|
+
errorDescription: errorMessage,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return { status: "error", error: "unknown_error" };
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* Handle regular OAuth callback (for authorization code flow)
|
|
171
|
+
*
|
|
172
|
+
* @param callbackUrl - Full callback URL with code and state
|
|
173
|
+
* @returns Tokens from token exchange
|
|
174
|
+
*/
|
|
175
|
+
async handleCallback(callbackUrl) {
|
|
176
|
+
const url = callbackUrl ?? (typeof window !== "undefined" ? window.location.href : "");
|
|
177
|
+
return await coreClient.handleCallback(url);
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Check if returnTo URL is safe (same origin)
|
|
183
|
+
* Prevents open redirect attacks
|
|
184
|
+
*/
|
|
185
|
+
function isSafeReturnTo(url) {
|
|
186
|
+
if (typeof window === "undefined") {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
const u = new URL(url, window.location.origin);
|
|
191
|
+
return u.origin === window.location.origin;
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -13,6 +13,16 @@ export interface AuthrimConfig {
|
|
|
13
13
|
issuer: string;
|
|
14
14
|
clientId: string;
|
|
15
15
|
storage?: StorageOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Enable OAuth 2.0 / OpenID Connect flows
|
|
18
|
+
* Default: false
|
|
19
|
+
*/
|
|
20
|
+
enableOAuth?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Silent login redirect URI (for OAuth callback)
|
|
23
|
+
* Default: {origin}/callback.html
|
|
24
|
+
*/
|
|
25
|
+
silentLoginRedirectUri?: string;
|
|
16
26
|
}
|
|
17
27
|
export interface AuthError {
|
|
18
28
|
code: string;
|
|
@@ -108,6 +118,61 @@ export interface CIBANamespace {
|
|
|
108
118
|
export interface LoginChallengeNamespace {
|
|
109
119
|
getData(challengeId: string): Promise<import("./direct-auth/login-challenge.js").LoginChallengeData>;
|
|
110
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Try silent login options
|
|
123
|
+
*/
|
|
124
|
+
export interface TrySilentLoginOptions {
|
|
125
|
+
/**
|
|
126
|
+
* What to do if IdP has no session (login_required)
|
|
127
|
+
* - 'return': Return to returnTo URL with sso_error=login_required
|
|
128
|
+
* - 'login': Redirect to login screen, then return after login
|
|
129
|
+
* Default: 'return'
|
|
130
|
+
*/
|
|
131
|
+
onLoginRequired?: "return" | "login";
|
|
132
|
+
/**
|
|
133
|
+
* URL to return after silent login completes
|
|
134
|
+
* Default: current page URL
|
|
135
|
+
* Security: Must be same origin
|
|
136
|
+
*/
|
|
137
|
+
returnTo?: string;
|
|
138
|
+
/**
|
|
139
|
+
* OAuth scopes to request
|
|
140
|
+
* Default: SDK default scopes
|
|
141
|
+
*/
|
|
142
|
+
scope?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Silent login result
|
|
146
|
+
*/
|
|
147
|
+
export type SilentLoginResult = {
|
|
148
|
+
status: "success";
|
|
149
|
+
} | {
|
|
150
|
+
status: "login_required";
|
|
151
|
+
} | {
|
|
152
|
+
status: "error";
|
|
153
|
+
error: string;
|
|
154
|
+
errorDescription?: string;
|
|
155
|
+
};
|
|
156
|
+
export interface OAuthNamespace {
|
|
157
|
+
/**
|
|
158
|
+
* Try silent SSO via top-level navigation (prompt=none)
|
|
159
|
+
*
|
|
160
|
+
* Safari ITP / Chrome Third-Party Cookie Phaseout compatible.
|
|
161
|
+
* This function redirects to IdP and does not return.
|
|
162
|
+
*/
|
|
163
|
+
trySilentLogin(options?: TrySilentLoginOptions): Promise<never>;
|
|
164
|
+
/**
|
|
165
|
+
* Handle silent login callback
|
|
166
|
+
*
|
|
167
|
+
* Call this in your callback page. Handles both silent login
|
|
168
|
+
* results and regular OAuth callbacks.
|
|
169
|
+
*/
|
|
170
|
+
handleSilentCallback(): Promise<SilentLoginResult>;
|
|
171
|
+
/**
|
|
172
|
+
* Handle regular OAuth callback (for authorization code flow)
|
|
173
|
+
*/
|
|
174
|
+
handleCallback(callbackUrl?: string): Promise<import("@authrim/core").TokenSet>;
|
|
175
|
+
}
|
|
111
176
|
export interface SignInShortcuts {
|
|
112
177
|
passkey(options?: PasskeyLoginOptions): Promise<AuthResponse<AuthSessionData>>;
|
|
113
178
|
social(provider: SocialProvider, options?: SocialLoginOptions): Promise<AuthResponse<AuthSessionData>>;
|
|
@@ -127,6 +192,8 @@ export interface AuthrimClient {
|
|
|
127
192
|
emailCode: EmailCodeNamespace;
|
|
128
193
|
social: SocialNamespace;
|
|
129
194
|
session: SessionNamespace;
|
|
195
|
+
/** OAuth 2.0 / OpenID Connect API (optional, enabled via config.enableOAuth) */
|
|
196
|
+
oauth?: OAuthNamespace;
|
|
130
197
|
/** Consent flow API */
|
|
131
198
|
consent: ConsentNamespace;
|
|
132
199
|
/** Device flow API (RFC 8628) */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EACV,OAAO,EACP,IAAI,EACJ,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,IAAI,cAAc,EAC5B,MAAM,kBAAkB,CA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AM,EAAE,UAAU,CAAC;IAEnB;;;;;;OAMG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE/D;;;;;;;OAOG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAMD,YAAY,EACV,OAAO,EACP,IAAI,EACJ,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client Configuration Fetcher
|
|
3
|
+
*
|
|
4
|
+
* Fetches public client configuration from the server's Public Config API.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Public client configuration from server
|
|
8
|
+
*/
|
|
9
|
+
export interface PublicClientConfig {
|
|
10
|
+
client_id: string;
|
|
11
|
+
client_name?: string;
|
|
12
|
+
logo_uri?: string;
|
|
13
|
+
client_uri?: string;
|
|
14
|
+
policy_uri?: string;
|
|
15
|
+
tos_uri?: string;
|
|
16
|
+
login_ui_url?: string;
|
|
17
|
+
initiate_login_uri?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch public client configuration from server
|
|
21
|
+
*
|
|
22
|
+
* This fetches configuration from the Public Config API endpoint:
|
|
23
|
+
* GET /oauth/clients/:client_id/config
|
|
24
|
+
*
|
|
25
|
+
* This endpoint is public (no authentication required) and cached for 5 minutes.
|
|
26
|
+
*
|
|
27
|
+
* @param issuer - Authrim issuer URL
|
|
28
|
+
* @param clientId - OAuth client ID
|
|
29
|
+
* @returns Public client configuration or null if fetch fails
|
|
30
|
+
*/
|
|
31
|
+
export declare function fetchClientConfig(issuer: string, clientId: string): Promise<PublicClientConfig | null>;
|
|
32
|
+
//# sourceMappingURL=client-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-config.d.ts","sourceRoot":"","sources":["../../src/lib/utils/client-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA0BpC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client Configuration Fetcher
|
|
3
|
+
*
|
|
4
|
+
* Fetches public client configuration from the server's Public Config API.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Fetch public client configuration from server
|
|
8
|
+
*
|
|
9
|
+
* This fetches configuration from the Public Config API endpoint:
|
|
10
|
+
* GET /oauth/clients/:client_id/config
|
|
11
|
+
*
|
|
12
|
+
* This endpoint is public (no authentication required) and cached for 5 minutes.
|
|
13
|
+
*
|
|
14
|
+
* @param issuer - Authrim issuer URL
|
|
15
|
+
* @param clientId - OAuth client ID
|
|
16
|
+
* @returns Public client configuration or null if fetch fails
|
|
17
|
+
*/
|
|
18
|
+
export async function fetchClientConfig(issuer, clientId) {
|
|
19
|
+
try {
|
|
20
|
+
// Normalize issuer URL (remove trailing slash)
|
|
21
|
+
const baseUrl = issuer.replace(/\/$/, '');
|
|
22
|
+
const url = `${baseUrl}/oauth/clients/${encodeURIComponent(clientId)}/config`;
|
|
23
|
+
const response = await fetch(url, {
|
|
24
|
+
method: 'GET',
|
|
25
|
+
headers: {
|
|
26
|
+
'Accept': 'application/json',
|
|
27
|
+
},
|
|
28
|
+
// Use cache to avoid unnecessary requests
|
|
29
|
+
cache: 'default',
|
|
30
|
+
});
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
console.warn(`Failed to fetch client config: ${response.status} ${response.statusText}`);
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const config = await response.json();
|
|
36
|
+
return config;
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.warn('Failed to fetch client config:', error);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { sanitizeForLogging, sanitizeJsonForLogging, maskValue, } from './sensitive-data.js';
|
|
2
2
|
export { getAuthrimCode, mapSeverity, ERROR_CODE_MAP } from './error-mapping.js';
|
|
3
|
+
export { fetchClientConfig, type PublicClientConfig } from './client-config.js';
|
|
3
4
|
export { convertToPublicKeyCredentialRequestOptions, convertToPublicKeyCredentialCreationOptions, assertionResponseToJSON, attestationResponseToJSON, } from './webauthn-converters.js';
|
|
4
5
|
export { success, failure, failureFromParams, toAuthError, authResultToResponse, wrapWithAuthResponse, } from './response.js';
|
|
5
6
|
export { AUTH_CONTEXT_KEY, setAuthContext, getAuthContext, hasAuthContext } from './context.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EACL,0CAA0C,EAC1C,2CAA2C,EAC3C,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EACL,0CAA0C,EAC1C,2CAA2C,EAC3C,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { sanitizeForLogging, sanitizeJsonForLogging, maskValue, } from './sensitive-data.js';
|
|
2
2
|
export { getAuthrimCode, mapSeverity, ERROR_CODE_MAP } from './error-mapping.js';
|
|
3
|
+
export { fetchClientConfig } from './client-config.js';
|
|
3
4
|
export { convertToPublicKeyCredentialRequestOptions, convertToPublicKeyCredentialCreationOptions, assertionResponseToJSON, attestationResponseToJSON, } from './webauthn-converters.js';
|
|
4
5
|
export { success, failure, failureFromParams, toAuthError, authResultToResponse, wrapWithAuthResponse, } from './response.js';
|
|
5
6
|
export { AUTH_CONTEXT_KEY, setAuthContext, getAuthContext, hasAuthContext } from './context.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authrim/sveltekit",
|
|
3
3
|
"packageManager": "pnpm@9.15.0",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"description": "SvelteKit SDK for Authrim authentication",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"svelte": "./dist/index.js",
|
|
@@ -71,7 +71,9 @@
|
|
|
71
71
|
"passkey",
|
|
72
72
|
"webauthn",
|
|
73
73
|
"social-login",
|
|
74
|
-
"session-management"
|
|
74
|
+
"session-management",
|
|
75
|
+
"sso",
|
|
76
|
+
"silent-auth"
|
|
75
77
|
],
|
|
76
78
|
"author": "Authrim <info@authrim.com>",
|
|
77
79
|
"license": "Apache-2.0",
|