9.0.0 • Published 21 days ago

@odx/auth v9.0.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
21 days ago

@odx/auth

Install 🚀

npm install @odx/auth

Library structure

  • @odx/auth: main entry point
    • provideAuth: Main provider factory to enable authentication for an Angular application
    • AuthModule: Angular module which bundles all components and directives for the UI
    • AuthService: Service to perform different tasks regarding authentication and authorization
    • authGuard: Angular guard to protect routes that require authentication or authorization
    • unauthGuard: Angular guard to protect routes that don't require authentication or authorization
    • ...
  • @odx/auth/plugins/service-connect: main entry point for service connect auth plugins
    • serviceConnectRightsPlugin: Auth plugin to load user rights from service connect
    • serviceConnectRightsGuard: Auth guard to check for service connect user rights
    • ServiceConnectRightsDirective: Auth directive to check for service connect user rights
    • ...

Usage

Import the AuthModule from @odx/auth and add it to the application imports, to configure it use the provideAuth function.

provideAuth({
  environment: 'dev',
  clientId: '<oktaClientId>',
});

The configuration object has the following interface:

interface AuthConfig {
  environment: AuthEnvironment;
  clientId: string;
  issuer?: string;
  redirectPath: string;
  allowedUrls: Array<string | RegExp>;
  timeoutFactor: number;
  maxOfflineTime: number;
  loadUserProfile: boolean;
  postLogoutRedirectUrl?: string;
  scopes?: string[];
  discoveryUrl?: string;
  errorHandler: AuthErrorHandlerFn;
  createInitials: CreateInitialsFn;
  resolveEmail: ResolveEmailFn;
  resolveUsername: ResolveUsernameFn;
  storage?: OAuthStorage;
  plugins: AuthPluginFactory[];
  defaultAuthorizedHandler?: AuthorizedHandler | null;
  enableLoadingScreen: boolean;
  refreshTokenOnInit?: boolean;
  loadingScreenMessage?: DynamicTextContent | null;
  userProfileUrl?: string;
  requireSignIn?: boolean;
  requireSignInForRequests?: boolean;
  waitForTokenInMs?: number;
  showDebugInformation?: boolean;
}

In order to add the UI for signing in and out, add the odx-auth component to the odx-header:

<odx-header>
  <odx-auth>
    <!-- custom content -->
  </odx-auth>
</odx-header>

Use the LocalizationService.setLanguage method from @odx/angular/localization to change the language.

9.0.0

21 days ago

8.1.0

3 months ago

8.0.1

3 months ago

8.0.0

4 months ago

7.0.0

4 months ago

6.0.2

4 months ago

5.1.1

6 months ago

5.1.0

6 months ago

5.0.0

7 months ago

6.0.1

5 months ago

6.0.0

6 months ago

1.0.3

10 months ago

2.0.0

10 months ago

3.4.0

8 months ago

3.1.3

9 months ago

3.3.0

8 months ago

3.1.2

9 months ago

3.2.0

8 months ago

3.1.1

9 months ago

3.1.0

9 months ago

3.0.1

9 months ago

3.5.0

8 months ago

3.0.0

9 months ago

4.0.5

8 months ago

4.0.4

8 months ago

4.0.7

7 months ago

4.0.6

8 months ago

4.0.1

8 months ago

4.0.0

8 months ago

4.0.3

8 months ago

4.0.2

8 months ago

1.0.2

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-rc.8

1 year ago

1.0.0-rc.5

1 year ago

1.0.0-rc.6

1 year ago

1.0.0-rc.3

1 year ago

1.0.0-rc.4

1 year ago

1.0.0-rc.1

1 year ago

1.0.0-rc.2

1 year ago

1.0.0-rc.0

1 year ago

1.0.0-alpha.1

1 year ago