ReactiveX enhanced OIDC and OAuth2 protocol support for browser-based JavaScript applications.
Go to file
lonelyhentxi e662d7d123
Some checks failed
Build, Lint & Test Lib / Build, Lint and Test Library (push) Has been cancelled
fix: fix solid-js adapter and exclude spec from build
2025-03-04 23:23:36 +08:00
.github ci: fix workflows 2025-02-06 04:34:59 +08:00
.vscode feat: init and fork some code from angular-auth-oidc-client 2025-01-17 04:24:12 +08:00
assets feat: add basic example 2025-02-06 04:26:07 +08:00
examples/react-tanstack-router feat: add solid-js support 2025-03-04 22:02:42 +08:00
licenses docs: first add docs and license 2025-02-02 02:23:41 +08:00
scripts fix: fix some tests 2025-02-02 00:45:46 +08:00
src fix: fix solid-js adapter and exclude spec from build 2025-03-04 23:23:36 +08:00
tests build: fix build and add examples 2025-02-05 22:49:38 +08:00
.editorconfig feat: init and fork some code from angular-auth-oidc-client 2025-01-17 04:24:12 +08:00
.gitignore build: fix build and add examples 2025-02-05 22:49:38 +08:00
biome.jsonc build: fix build and add examples 2025-02-05 22:49:38 +08:00
LICENSE Initial commit 2025-01-16 04:31:02 +08:00
package.json fix: fix solid-js adapter and exclude spec from build 2025-03-04 23:23:36 +08:00
playwright.config.ts docs: first add docs and license 2025-02-02 02:23:41 +08:00
pnpm-lock.yaml fix: fix solid-js adapter and exclude spec from build 2025-03-04 23:23:36 +08:00
pnpm-workspace.yaml build: fix build and add examples 2025-02-05 22:49:38 +08:00
README.md feat: add more auth features and remove auth module 2025-02-07 16:48:38 +08:00
rslib.config.ts fix: fix solid-js adapter and exclude spec from build 2025-03-04 23:23:36 +08:00
tsconfig.base.json build: fix build and add examples 2025-02-05 22:49:38 +08:00
tsconfig.json build: fix build and add examples 2025-02-05 22:49:38 +08:00
tsconfig.lib.json build: fix build and add examples 2025-02-05 22:49:38 +08:00
tsconfig.scripts.json build: fix build and add examples 2025-02-05 22:49:38 +08:00
tsconfig.spec.json build: fix build and add examples 2025-02-05 22:49:38 +08:00
vitest.config.ts refactor: switch from jsdom to happy-dom 2025-02-18 16:00:16 +08:00

OUTPOSTS
OIDC-CLIENT-RX
build-status status-badge

ReactiveX enhanced OIDC and OAuth2 protocol support for browser-based JavaScript applications.

Quick Start

@TODO Add More Details

Install

pnpm add oidc-client-rx @outposts/injection-js @abraham/reflection
# npm install oidc-client-rx @outposts/injection-js @abraham/reflection
# yarn add oidc-client-rx @outposts/injection-js @abraham/reflection

Basic Usage

import '@abraham/reflection'; // or 'reflect-metadata' | 'core-js/es7/reflect'
import { type Injector, ReflectiveInjector } from '@outposts/injection-js';
import { LogLevel, OidcSecurityService, provideAuth, withDefaultFeatures } from 'oidc-client-rx';

const injector = ReflectiveInjector.resolveAndCreate(
  provideAuth(
    {
      config: {
        authority: '<your-authority>',
        redirectUrl: `${window.location.origin}/auth/callback`,
        postLogoutRedirectUri: window.location.origin,
        clientId: '<your-client-id>',
        scope: 'openid profile email offline_access',
        responseType: 'code',
        silentRenew: true,
        useRefreshToken: true,
        logLevel: LogLevel.Debug,
        ...
      },
    },
    withDefaultFeatures()
  )
) as Injector;

const oidcSecurityService = injector.get(OidcSecurityService);

oidcSecurityService.checkAuth().subscribe((result) => {
  console.debug('checkAuth result: ', result);
});

const isAuthenticated$ = oidcSecurityService.isAuthenticated$;

More Examples

License

MIT