@inrupt/solid-client-authn-browser 1.17.1 → 1.17.3
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 +7 -0
- package/dist/Session.d.ts +174 -0
- package/dist/constant.d.ts +2 -2
- package/dist/defaultSession.d.ts +70 -0
- package/dist/dependencies.d.ts +12 -0
- package/dist/index.js +833 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +833 -34
- package/dist/index.mjs.map +1 -1
- package/dist/login/oidc/AggregateOidcHandler.d.ts +10 -0
- package/dist/login/oidc/AggregateRedirectHandler.d.ts +10 -0
- package/dist/login/oidc/ClientRegistrar.d.ts +7 -0
- package/dist/login/oidc/IssuerConfigFetcher.d.ts +10 -0
- package/dist/login/oidc/OidcLoginHandler.d.ts +10 -0
- package/dist/login/oidc/Redirector.d.ts +7 -0
- package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.d.ts +3 -0
- package/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.d.ts +10 -0
- package/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.d.ts +10 -0
- package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.d.ts +12 -0
- package/dist/login/oidc/refresh/TokenRefresher.d.ts +7 -0
- package/dist/logout/buildRpInitiatedLogout.d.ts +7 -0
- package/dist/sessionInfo/SessionInfoManager.d.ts +18 -0
- package/dist/solid-client-authn.bundle.js +7 -7
- package/dist/solid-client-authn.bundle.js.map +1 -1
- package/dist/storage/BrowserStorage.d.ts +7 -0
- package/dist/storage/StorageUtility.d.ts +14 -0
- package/dist/util/UuidGenerator.d.ts +6 -0
- package/package.json +8 -8
- package/rollup.config.mjs +1 -1
- package/src/ClientAuthentication.spec.ts +106 -57
- package/src/ClientAuthentication.ts +18 -7
- package/src/Session.spec.ts +51 -54
- package/src/Session.ts +24 -18
- package/src/__mocks__/ClientAuthentication.ts +2 -2
- package/src/defaultSession.ts +4 -3
- package/src/dependencies.ts +5 -5
- package/src/login/oidc/ClientRegistrar.spec.ts +22 -22
- package/src/login/oidc/ClientRegistrar.ts +4 -2
- package/src/login/oidc/IssuerConfigFetcher.spec.ts +25 -25
- package/src/login/oidc/IssuerConfigFetcher.ts +8 -6
- package/src/login/oidc/OidcLoginHandler.spec.ts +15 -15
- package/src/login/oidc/OidcLoginHandler.ts +14 -9
- package/src/login/oidc/Redirector.spec.ts +1 -1
- package/src/login/oidc/__mocks__/ClientRegistrar.ts +3 -3
- package/src/login/oidc/__mocks__/IssuerConfigFetcher.ts +3 -3
- package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.spec.ts +42 -42
- package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.ts +19 -13
- package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.spec.ts +12 -12
- package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.ts +2 -2
- package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.spec.ts +7 -7
- package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.ts +2 -2
- package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +17 -17
- package/src/login/oidc/refresh/TokenRefresher.spec.ts +14 -14
- package/src/login/oidc/refresh/TokenRefresher.ts +12 -8
- package/src/login/oidc/refresh/__mocks__/TokenRefresher.ts +1 -1
- package/src/sessionInfo/SessionInfoManager.spec.ts +37 -15
- package/src/sessionInfo/SessionInfoManager.ts +46 -50
- package/src/sessionInfo/__mocks__/SessionInfoManager.ts +3 -3
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Responsible for fetching an IDP configuration
|
|
7
|
+
*/
|
|
1
8
|
import type { IIssuerConfig, IIssuerConfigFetcher, IStorageUtility } from "@inrupt/solid-client-authn-core";
|
|
2
9
|
export declare const WELL_KNOWN_OPENID_CONFIG = ".well-known/openid-configuration";
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
3
13
|
export default class IssuerConfigFetcher implements IIssuerConfigFetcher {
|
|
4
14
|
private storageUtility;
|
|
5
15
|
constructor(storageUtility: IStorageUtility);
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Handles Common Oidc login functions (Like fetching the configuration)
|
|
7
|
+
*/
|
|
1
8
|
import type { IClientRegistrar, IIssuerConfigFetcher, ILoginOptions, ILoginHandler, IOidcHandler, IStorageUtility, LoginResult } from "@inrupt/solid-client-authn-core";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
2
12
|
export default class OidcLoginHandler implements ILoginHandler {
|
|
3
13
|
private storageUtility;
|
|
4
14
|
private oidcHandler;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
1
5
|
import type { IRedirector, IRedirectorOptions } from "@inrupt/solid-client-authn-core";
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
2
9
|
export default class Redirector implements IRedirector {
|
|
3
10
|
redirect(redirectUrl: string, options?: IRedirectorOptions): void;
|
|
4
11
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { IClientRegistrar, IIssuerConfigFetcher, IIncomingRedirectHandler, ISessionInfoManager, IStorageUtility, ITokenRefresher, IncomingRedirectResult } from "@inrupt/solid-client-authn-core";
|
|
3
3
|
import type { EventEmitter } from "events";
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
4
7
|
export declare class AuthCodeRedirectHandler implements IIncomingRedirectHandler {
|
|
5
8
|
private storageUtility;
|
|
6
9
|
private sessionInfoManager;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
2
6
|
import type { IIncomingRedirectHandler, ISessionInfo } from "@inrupt/solid-client-authn-core";
|
|
3
7
|
import type { EventEmitter } from "events";
|
|
8
|
+
/**
|
|
9
|
+
* This class handles redirect IRIs without any query params, and returns an unauthenticated
|
|
10
|
+
* session. It serves as a fallback so that consuming libraries don't have to test
|
|
11
|
+
* for the query params themselves, and can always try to use them as a redirect IRI.
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
4
14
|
export declare class ErrorOidcHandler implements IIncomingRedirectHandler {
|
|
5
15
|
canHandle(redirectUrl: string): Promise<boolean>;
|
|
6
16
|
handle(redirectUrl: string, eventEmitter?: EventEmitter): Promise<ISessionInfo & {
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
1
5
|
import type { IIncomingRedirectHandler, ISessionInfo } from "@inrupt/solid-client-authn-core";
|
|
6
|
+
/**
|
|
7
|
+
* This class handles redirect IRIs without any query params, and returns an unauthenticated
|
|
8
|
+
* session. It serves as a fallback so that consuming libraries don't have to test
|
|
9
|
+
* for the query params themselves, and can always try to use them as a redirect IRI.
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
2
12
|
export declare class FallbackRedirectHandler implements IIncomingRedirectHandler {
|
|
3
13
|
canHandle(redirectUrl: string): Promise<boolean>;
|
|
4
14
|
handle(_redirectUrl: string): Promise<ISessionInfo & {
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Handler for the Authorization Code with PKCE Flow
|
|
7
|
+
*/
|
|
1
8
|
import type { IOidcHandler, IOidcOptions, LoginResult } from "@inrupt/solid-client-authn-core";
|
|
2
9
|
import { AuthorizationCodeWithPkceOidcHandlerBase } from "@inrupt/solid-client-authn-core";
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
* Authorization code flow spec: https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth
|
|
13
|
+
* PKCE: https://tools.ietf.org/html/rfc7636
|
|
14
|
+
*/
|
|
3
15
|
export default class AuthorizationCodeWithPkceOidcHandler extends AuthorizationCodeWithPkceOidcHandlerBase implements IOidcHandler {
|
|
4
16
|
handle(oidcLoginOptions: IOidcOptions): Promise<LoginResult>;
|
|
5
17
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
2
6
|
import type { IClientRegistrar, IIssuerConfigFetcher, IStorageUtility, KeyPair, ITokenRefresher, TokenEndpointResponse } from "@inrupt/solid-client-authn-core";
|
|
3
7
|
import type { EventEmitter } from "events";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
4
11
|
export default class TokenRefresher implements ITokenRefresher {
|
|
5
12
|
private storageUtility;
|
|
6
13
|
private issuerConfigFetcher;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { IEndSessionOptions, IRpLogoutOptions } from "@inrupt/solid-client-authn-core";
|
|
2
|
+
/**
|
|
3
|
+
* @param options.endSessionEndpoint The end_session_endpoint advertised by the server
|
|
4
|
+
* @param options.idTokenHint The idToken supplied by the server after logging in
|
|
5
|
+
* Redirects the window to the location required to perform RP initiated logout
|
|
6
|
+
*
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
2
9
|
export declare function buildRpInitiatedLogout({ endSessionEndpoint, idTokenHint, }: Omit<IEndSessionOptions, keyof IRpLogoutOptions>): ({ state, postLogoutUrl }: IRpLogoutOptions) => void;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
1
5
|
import type { ISessionInfo, ISessionInfoManager, ISessionInternalInfo, IStorageUtility } from "@inrupt/solid-client-authn-core";
|
|
2
6
|
import { SessionInfoManagerBase } from "@inrupt/solid-client-authn-core";
|
|
3
7
|
export { getUnauthenticatedSession } from "@inrupt/solid-client-authn-core";
|
|
8
|
+
/**
|
|
9
|
+
* @param sessionId
|
|
10
|
+
* @param storage
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
4
13
|
export declare function clear(sessionId: string, storage: IStorageUtility): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
5
17
|
export declare class SessionInfoManager extends SessionInfoManagerBase implements ISessionInfoManager {
|
|
6
18
|
get(sessionId: string): Promise<(ISessionInfo & ISessionInternalInfo) | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* This function removes all session-related information from storage.
|
|
21
|
+
* @param sessionId the session identifier
|
|
22
|
+
* @param storage the storage where session info is stored
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
7
25
|
clear(sessionId: string): Promise<void>;
|
|
8
26
|
}
|