@inrupt/solid-client-authn-browser 1.11.8-alpha.1 → 1.11.8-alpha.2
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/ClientAuthentication.d.ts +18 -17
- package/dist/Session.d.ts +35 -35
- package/dist/constant.d.ts +2 -2
- package/dist/defaultSession.d.ts +9 -9
- package/dist/dependencies.d.ts +6 -6
- package/dist/iframe.d.ts +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.es.js +1693 -0
- package/dist/index.js +1717 -27
- package/dist/login/AggregateLoginHandler.d.ts +4 -4
- package/dist/login/oidc/AggregateOidcHandler.d.ts +4 -4
- package/dist/login/oidc/ClientRegistrar.d.ts +6 -6
- package/dist/login/oidc/IssuerConfigFetcher.d.ts +8 -8
- package/dist/login/oidc/OidcLoginHandler.d.ts +10 -10
- package/dist/login/oidc/Redirector.d.ts +4 -4
- package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.d.ts +8 -8
- package/dist/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.d.ts +9 -9
- package/dist/login/oidc/redirectHandler/AggregateRedirectHandler.d.ts +4 -4
- package/dist/login/oidc/redirectHandler/AuthCodeRedirectHandler.d.ts +15 -15
- package/dist/login/oidc/redirectHandler/ErrorOidcHandler.d.ts +9 -9
- package/dist/login/oidc/redirectHandler/FallbackRedirectHandler.d.ts +7 -7
- package/dist/login/oidc/refresh/TokenRefresher.d.ts +10 -10
- package/dist/login/webid/WebIdLoginHandler.d.ts +5 -5
- package/dist/logout/GeneralLogoutHandler.d.ts +7 -7
- package/dist/sessionInfo/SessionInfoManager.d.ts +16 -16
- package/dist/solid-client-authn.bundle.js +1720 -2
- package/dist/storage/BrowserStorage.d.ts +7 -7
- package/dist/storage/StorageUtility.d.ts +4 -4
- package/dist/util/UuidGenerator.d.ts +6 -6
- package/dist/util/urlPath.d.ts +1 -1
- package/examples/demoClientApp/package-lock.json +67 -0
- package/examples/demoClientApp/package.json +2 -1
- package/examples/demoClientApp/src/DemoClientApp.js +9 -1
- package/jest.config.js +2 -1
- package/package.json +13 -10
- package/rollup.config.js +57 -0
- package/src/ClientAuthentication.spec.ts +69 -1
- package/src/ClientAuthentication.ts +32 -14
- package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +2 -9
- package/src/login/oidc/redirectHandler/__mocks__/RedirectHandler.ts +13 -0
- package/src/index.browser.spec.ts +0 -27
- package/src/index.browser.ts +0 -24
- package/webpack.browser.js +0 -19
- package/webpack.common.js +0 -22
- package/webpack.config.js +0 -8
- package/webpack.dev.js +0 -17
- package/webpack.prod.js +0 -3
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { ILoginHandler, ILogoutHandler, IRedirectHandler, ISessionInfo, ISessionInfoManager, IIssuerConfigFetcher, ISessionInternalInfo, ILoginOptions } from "@inrupt/solid-client-authn-core";
|
|
2
|
-
import { EventEmitter } from "events";
|
|
3
|
-
export default class ClientAuthentication {
|
|
4
|
-
private loginHandler;
|
|
5
|
-
private redirectHandler;
|
|
6
|
-
private logoutHandler;
|
|
7
|
-
private sessionInfoManager;
|
|
8
|
-
private issuerConfigFetcher;
|
|
9
|
-
constructor(loginHandler: ILoginHandler, redirectHandler: IRedirectHandler, logoutHandler: ILogoutHandler, sessionInfoManager: ISessionInfoManager, issuerConfigFetcher: IIssuerConfigFetcher);
|
|
10
|
-
login: (options: ILoginOptions, eventEmitter: EventEmitter) => Promise<void>;
|
|
11
|
-
fetch: ((input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>) & typeof fetch;
|
|
12
|
-
logout: (sessionId: string) => Promise<void>;
|
|
13
|
-
getSessionInfo: (sessionId: string) => Promise<(ISessionInfo & ISessionInternalInfo) | undefined>;
|
|
14
|
-
getAllSessionInfo: () => Promise<ISessionInfo[]>;
|
|
15
|
-
validateCurrentSession: (currentSessionId: string) => Promise<(ISessionInfo & ISessionInternalInfo) | null>;
|
|
16
|
-
handleIncomingRedirect: (url: string, eventEmitter: EventEmitter) => Promise<ISessionInfo | undefined>;
|
|
17
|
-
|
|
1
|
+
import { ILoginHandler, ILogoutHandler, IRedirectHandler, ISessionInfo, ISessionInfoManager, IIssuerConfigFetcher, ISessionInternalInfo, ILoginOptions } from "@inrupt/solid-client-authn-core";
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
export default class ClientAuthentication {
|
|
4
|
+
private loginHandler;
|
|
5
|
+
private redirectHandler;
|
|
6
|
+
private logoutHandler;
|
|
7
|
+
private sessionInfoManager;
|
|
8
|
+
private issuerConfigFetcher;
|
|
9
|
+
constructor(loginHandler: ILoginHandler, redirectHandler: IRedirectHandler, logoutHandler: ILogoutHandler, sessionInfoManager: ISessionInfoManager, issuerConfigFetcher: IIssuerConfigFetcher);
|
|
10
|
+
login: (options: ILoginOptions, eventEmitter: EventEmitter) => Promise<void>;
|
|
11
|
+
fetch: ((input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>) & typeof fetch;
|
|
12
|
+
logout: (sessionId: string) => Promise<void>;
|
|
13
|
+
getSessionInfo: (sessionId: string) => Promise<(ISessionInfo & ISessionInternalInfo) | undefined>;
|
|
14
|
+
getAllSessionInfo: () => Promise<ISessionInfo[]>;
|
|
15
|
+
validateCurrentSession: (currentSessionId: string) => Promise<(ISessionInfo & ISessionInternalInfo) | null>;
|
|
16
|
+
handleIncomingRedirect: (url: string, eventEmitter: EventEmitter) => Promise<ISessionInfo | undefined>;
|
|
17
|
+
private cleanUrlAfterRedirect;
|
|
18
|
+
}
|
package/dist/Session.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from "events";
|
|
3
|
-
import { ILoginInputOptions, ISessionInfo, IStorage } from "@inrupt/solid-client-authn-core";
|
|
4
|
-
import ClientAuthentication from "./ClientAuthentication";
|
|
5
|
-
export interface ISessionOptions {
|
|
6
|
-
secureStorage: IStorage;
|
|
7
|
-
insecureStorage: IStorage;
|
|
8
|
-
sessionInfo: ISessionInfo;
|
|
9
|
-
clientAuthentication: ClientAuthentication;
|
|
10
|
-
}
|
|
11
|
-
export interface IHandleIncomingRedirectOptions {
|
|
12
|
-
restorePreviousSession?: boolean;
|
|
13
|
-
useEssSession?: boolean;
|
|
14
|
-
url?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function silentlyAuthenticate(sessionId: string, clientAuthn: ClientAuthentication, options: {
|
|
17
|
-
inIframe?: boolean | undefined;
|
|
18
|
-
} | undefined, session: Session): Promise<boolean>;
|
|
19
|
-
export declare class Session extends EventEmitter {
|
|
20
|
-
readonly info: ISessionInfo;
|
|
21
|
-
private clientAuthentication;
|
|
22
|
-
private tokenRequestInProgress;
|
|
23
|
-
constructor(sessionOptions?: Partial<ISessionOptions>, sessionId?: string);
|
|
24
|
-
login: (options: ILoginInputOptions) => Promise<void>;
|
|
25
|
-
fetch: (url: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
26
|
-
private internalLogout;
|
|
27
|
-
logout: () => Promise<void>;
|
|
28
|
-
handleIncomingRedirect: (inputOptions?: string | IHandleIncomingRedirectOptions) => Promise<ISessionInfo | undefined>;
|
|
29
|
-
onLogin(callback: () => unknown): void;
|
|
30
|
-
onLogout(callback: () => unknown): void;
|
|
31
|
-
onError(callback: (error: string | null, errorDescription?: string | null) => unknown): void;
|
|
32
|
-
onSessionRestore(callback: (currentUrl: string) => unknown): void;
|
|
33
|
-
onSessionExpiration(callback: () => unknown): void;
|
|
34
|
-
private setSessionInfo;
|
|
35
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
import { ILoginInputOptions, ISessionInfo, IStorage } from "@inrupt/solid-client-authn-core";
|
|
4
|
+
import ClientAuthentication from "./ClientAuthentication";
|
|
5
|
+
export interface ISessionOptions {
|
|
6
|
+
secureStorage: IStorage;
|
|
7
|
+
insecureStorage: IStorage;
|
|
8
|
+
sessionInfo: ISessionInfo;
|
|
9
|
+
clientAuthentication: ClientAuthentication;
|
|
10
|
+
}
|
|
11
|
+
export interface IHandleIncomingRedirectOptions {
|
|
12
|
+
restorePreviousSession?: boolean;
|
|
13
|
+
useEssSession?: boolean;
|
|
14
|
+
url?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function silentlyAuthenticate(sessionId: string, clientAuthn: ClientAuthentication, options: {
|
|
17
|
+
inIframe?: boolean | undefined;
|
|
18
|
+
} | undefined, session: Session): Promise<boolean>;
|
|
19
|
+
export declare class Session extends EventEmitter {
|
|
20
|
+
readonly info: ISessionInfo;
|
|
21
|
+
private clientAuthentication;
|
|
22
|
+
private tokenRequestInProgress;
|
|
23
|
+
constructor(sessionOptions?: Partial<ISessionOptions>, sessionId?: string);
|
|
24
|
+
login: (options: ILoginInputOptions) => Promise<void>;
|
|
25
|
+
fetch: (url: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
26
|
+
private internalLogout;
|
|
27
|
+
logout: () => Promise<void>;
|
|
28
|
+
handleIncomingRedirect: (inputOptions?: string | IHandleIncomingRedirectOptions) => Promise<ISessionInfo | undefined>;
|
|
29
|
+
onLogin(callback: () => unknown): void;
|
|
30
|
+
onLogout(callback: () => unknown): void;
|
|
31
|
+
onError(callback: (error: string | null, errorDescription?: string | null) => unknown): void;
|
|
32
|
+
onSessionRestore(callback: (currentUrl: string) => unknown): void;
|
|
33
|
+
onSessionExpiration(callback: () => unknown): void;
|
|
34
|
+
private setSessionInfo;
|
|
35
|
+
}
|
package/dist/constant.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const KEY_CURRENT_SESSION: string;
|
|
2
|
-
export declare const KEY_CURRENT_URL: string;
|
|
1
|
+
export declare const KEY_CURRENT_SESSION: string;
|
|
2
|
+
export declare const KEY_CURRENT_URL: string;
|
package/dist/defaultSession.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Session } from "./Session";
|
|
2
|
-
export declare function getDefaultSession(): Session;
|
|
3
|
-
export declare const fetch: Session["fetch"];
|
|
4
|
-
export declare const login: Session["login"];
|
|
5
|
-
export declare const logout: Session["logout"];
|
|
6
|
-
export declare const handleIncomingRedirect: Session["handleIncomingRedirect"];
|
|
7
|
-
export declare const onLogin: Session["onLogin"];
|
|
8
|
-
export declare const onLogout: Session["onLogout"];
|
|
9
|
-
export declare const onSessionRestore: Session["onSessionRestore"];
|
|
1
|
+
import { Session } from "./Session";
|
|
2
|
+
export declare function getDefaultSession(): Session;
|
|
3
|
+
export declare const fetch: Session["fetch"];
|
|
4
|
+
export declare const login: Session["login"];
|
|
5
|
+
export declare const logout: Session["logout"];
|
|
6
|
+
export declare const handleIncomingRedirect: Session["handleIncomingRedirect"];
|
|
7
|
+
export declare const onLogin: Session["onLogin"];
|
|
8
|
+
export declare const onLogout: Session["onLogout"];
|
|
9
|
+
export declare const onSessionRestore: Session["onSessionRestore"];
|
package/dist/dependencies.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IStorage } from "@inrupt/solid-client-authn-core";
|
|
2
|
-
import ClientAuthentication from "./ClientAuthentication";
|
|
3
|
-
export declare function getClientAuthenticationWithDependencies(dependencies: {
|
|
4
|
-
secureStorage?: IStorage;
|
|
5
|
-
insecureStorage?: IStorage;
|
|
6
|
-
}): ClientAuthentication;
|
|
1
|
+
import { IStorage } from "@inrupt/solid-client-authn-core";
|
|
2
|
+
import ClientAuthentication from "./ClientAuthentication";
|
|
3
|
+
export declare function getClientAuthenticationWithDependencies(dependencies: {
|
|
4
|
+
secureStorage?: IStorage;
|
|
5
|
+
insecureStorage?: IStorage;
|
|
6
|
+
}): ClientAuthentication;
|
package/dist/iframe.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function redirectInIframe(redirectUrl: string): void;
|
|
2
|
-
export declare function setupIframeListener(handleIframeRedirect: (redirectUrl: string) => Promise<unknown>): void;
|
|
3
|
-
export declare function postRedirectUrlToParent(redirectUrl: string): void;
|
|
1
|
+
export declare function redirectInIframe(redirectUrl: string): void;
|
|
2
|
+
export declare function setupIframeListener(handleIframeRedirect: (redirectUrl: string) => Promise<unknown>): void;
|
|
3
|
+
export declare function postRedirectUrlToParent(redirectUrl: string): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Session, ISessionOptions } from "./Session";
|
|
2
|
-
export { getClientAuthenticationWithDependencies } from "./dependencies";
|
|
3
|
-
export * from "./defaultSession";
|
|
4
|
-
export { ILoginInputOptions, ISessionInfo, IStorage, NotImplementedError, ConfigurationError, InMemoryStorage, } from "@inrupt/solid-client-authn-core";
|
|
1
|
+
export { Session, ISessionOptions } from "./Session";
|
|
2
|
+
export { getClientAuthenticationWithDependencies } from "./dependencies";
|
|
3
|
+
export * from "./defaultSession";
|
|
4
|
+
export { ILoginInputOptions, ISessionInfo, IStorage, NotImplementedError, ConfigurationError, InMemoryStorage, } from "@inrupt/solid-client-authn-core";
|