14.0.0 • Published 9 months ago

@odx/auth v14.0.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
9 months 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
    • serviceConnectUserProfilePlugin: Auth plugin to load user profile including language settings from service connect
    • 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.

13.2.0

9 months ago

14.0.0

9 months ago

13.2.1

9 months ago

13.1.0

9 months ago

10.0.0

1 year ago

12.0.0

12 months ago

11.0.0

12 months ago

13.0.0

11 months ago

12.1.0

11 months ago

9.0.0

1 year ago

8.1.0

1 year ago

8.0.1

1 year ago

8.0.0

1 year ago

7.0.0

1 year ago

6.0.2

1 year ago

5.1.1

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

1.0.3

2 years ago

2.0.0

2 years ago

3.4.0

2 years ago

3.1.3

2 years ago

3.3.0

2 years ago

3.1.2

2 years ago

3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.5.0

2 years ago

3.0.0

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.7

2 years ago

4.0.6

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-rc.8

2 years ago

1.0.0-rc.5

2 years ago

1.0.0-rc.6

2 years ago

1.0.0-rc.3

2 years ago

1.0.0-rc.4

2 years ago

1.0.0-rc.1

2 years ago

1.0.0-rc.2

2 years ago

1.0.0-rc.0

2 years ago

1.0.0-alpha.1

2 years ago