@innotec/auth-plugin
The plugin to authorize on innotec infrastructure
Last updated 5 days ago by mwiesmueller .
Original npm · Tarball · package.json
$ cnpm install @innotec/auth-plugin 
SYNC missed versions from official npm registry.

Innotec Auth Plugin

The Innotec-Auth-Plugin is designed to handle all authentication processes for applications where's conntected to the innotec v2 infrastructure. Theses plugin provides different authentication processes:

  • Authentication over authentication providers (Google, PayPal, Facebook ...)
  • Authentication over the Innotec V2 Infrastructure (Authentication by username and password)

With this module its easy to connect the infrastructure.

Installation

NOTE: please use npm 3.* ((sudo) npm i -g npm@3)

npm i --save --save-exact @innotec/auth-plugin

Note!

The npm Module innotec-auth-plugin is deprecated. All Modules are provided in root of @innotec

Import in your app module

You can import the module in your Application with:

import { InnotecAuthPlugin } from "innotec-auth-plugin";

Integration Steps

First

At first you must set your personal options of your app. To set this options call the initAuth Service by APP_INITIALIZER in app.module:


import { InnotecAuthPluginModule, InitAuth } from "../../index";

export function init_app(init: InitAuth): () => Promise<any> {
  return (): Promise<any> => {
    return new Promise((resolve, reject) => {
      (async () => {
        let options = {
          companyLogo: "http://yourLogoURL",    // You can define a own logo of your companyLogo. Default is the logo of the Innotec Company
          clientId: "Innotec Client ID",        // Your clientId from Innotec
          clientSecret: "Innotec Client Secret",// Your clientSecret from Innotec
          facebook_clientId: "abc",             // The Facebook Client_ID for OAuth
          google_clientId: "abc",               // The Google Client_ID for OAuth
          paypal_clientId: "abc",               // The PayPal Client_ID for OAuth
          forgotPassurl: "http://..."           // The Url of the forgot password
          endpoint: "live",                     // Switch for the endpoints. Sandbox is comming soon. live is default.
          newAccountUrl: "url",                 // Defines the url where the user can be register... Default is "https://account.v2.werbasinnotec.com/newaccount"
          closeable: true                       // Boolen to define if the loginwindow is closeable
        };

        await init.module(options);
        resolve();
      })();
    });
  };
}


NgModule({
  imports: [
    InnotecAuthPluginModule,
    .
    .
  ],
  declarations: [
    .
    .
    .
  ],
  providers: [
    JwtHelper,
    {
        provide: APP_INITIALIZER,
        useFactory: init_app,
        deps: [ InitAuth ],
        multi: true,
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor() {}
}

Second

At next you can import the loginfield in your login page:

<login-field></login-field>

The loginfield provides all necessary services to connect the innotec infrastructure. You can import this field as mat-dialog, too.

Third

To check the loginstate you can call the auth service:

import { CheckAuthStatus } from 'innotec-auth-plugin';

export class YoUrClAsSs {
  constructor (private auth: CheckAuthStatus) {

  }

  public yourService() {
    this.auth.check(); // returns true or false
  }
}


You can subscribe the variable also:

  this.auth.isLoggedIn().subscribe((state) => {
    this.isLoggedIn = state
  });

Additional services

CheckAuthStatus:

  • logout(): User will logged out - Cookie will deleted.
  • getTokenInfo(): Will response all tokeninfo. Ex. userObj.gravatarURL is the users picture

UserRights

  • validateRightTopic([systemId], [RightTopic], [orgaId], [minApiVersion])

With this method it's possible to validate a right-topic by systemId, orgaId and minApiVersion. The property minApiVersion is not required. When it's defined, the method will check the defined Version to the backend. Is the backendVersion greater or equal the minApiVersion the function will return true. (When the user has the right by the topic)

  • getAuthorizedSystems()

This method will response an array with all authorized systems and entrypoints.

InformationService

  • getUserInfos() This method will response the complete userObject where's saved in the cloud backend system.

  • getOrgaInfos(systemId) This method will response the complete OrganizationObject by the called systemId

Store the user-information into electron

With default javascript methods are not possible to store cookies into the chromium extension of electron. To enable the autologin feature / storing user information it's neccessary to save the information by the ipc-renderer module of electron.

Flow

Subscribe the Cookieservice events in app.module.ts of your electron App

import { CookieService } from '@innotec/auth-plugin';

.
.
.

ngOnInit() {
  this.cookie.observe().subscribe(data => {
    // data = { name: <nameofcookie>, value: <valueofcookie>, status: 'NEW || DELETE' }
    // Write the information of data everywhere.. :-)
  });
}

Write the object from the observeable into the authentication plugin on startup (APP_INITIALIZER)

import { InitAuth } from '@innotec/auth-plugin';

.
.
.

  setConfiguration() {
    this.configObject = ....

    this.cookieObject = // Load the object from your IPC Renderer
    .
    .
    .
    this.init(this.configObject, this.cookieObject);
  }
}

Current Tags

  • 3.3.3                                ...           latest (5 days ago)

232 Versions

  • 3.3.3                                ...           5 days ago
  • 3.3.2                                ...           5 days ago
  • 3.3.1                                ...           5 days ago
  • 3.3.0                                ...           5 days ago
  • 3.2.4                                ...           12 days ago
  • 3.2.3                                ...           16 days ago
  • 3.2.2                                ...           16 days ago
  • 3.2.1                                ...           16 days ago
  • 3.2.0                                ...           16 days ago
  • 3.1.6                                ...           a month ago
  • 3.1.5                                ...           2 months ago
  • 3.1.4                                ...           3 months ago
  • 3.1.3                                ...           3 months ago
  • 3.1.2                                ...           3 months ago
  • 3.1.1                                ...           3 months ago
  • 3.1.0                                ...           3 months ago
  • 3.0.6                                ...           3 months ago
  • 3.0.5                                ...           4 months ago
  • 3.0.4                                ...           4 months ago
  • 3.0.3                                ...           4 months ago
  • 3.0.2                                ...           4 months ago
  • 3.0.0                                ...           4 months ago
  • 2.5.7                                ...           5 months ago
  • 2.5.6                                ...           5 months ago
  • 2.5.5                                ...           5 months ago
  • 2.5.4                                ...           5 months ago
  • 2.5.3                                ...           5 months ago
  • 2.5.2                                ...           5 months ago
  • 2.5.1                                ...           5 months ago
  • 2.5.0                                ...           5 months ago
  • 2.4.9                                ...           5 months ago
  • 2.4.8                                ...           5 months ago
  • 2.4.7                                ...           5 months ago
  • 2.4.5                                ...           5 months ago
  • 2.4.4                                ...           5 months ago
  • 2.4.3                                ...           5 months ago
  • 2.4.2                                ...           5 months ago
  • 2.4.1                                ...           5 months ago
  • 2.4.0                                ...           5 months ago
  • 1.3.12-V1-85                                ...           6 months ago
  • 2.3.3                                ...           7 months ago
  • 2.3.2                                ...           7 months ago
  • 2.3.1                                ...           7 months ago
  • 2.3.0                                ...           7 months ago
  • 2.2.3                                ...           7 months ago
  • 2.2.2                                ...           7 months ago
  • 2.2.1                                ...           8 months ago
  • 2.2.0                                ...           8 months ago
  • 2.1.5                                ...           8 months ago
  • 2.1.4                                ...           8 months ago
  • 2.1.2                                ...           8 months ago
  • 2.1.1                                ...           8 months ago
  • 2.1.0                                ...           9 months ago
  • 2.0.26                                ...           9 months ago
  • 2.0.25                                ...           9 months ago
  • 2.0.24                                ...           9 months ago
  • 2.0.23                                ...           9 months ago
  • 2.0.22                                ...           9 months ago
  • 2.0.21                                ...           9 months ago
  • 2.0.20                                ...           9 months ago
  • 2.0.19                                ...           9 months ago
  • 2.0.18                                ...           9 months ago
  • 2.0.17                                ...           9 months ago
  • 2.0.16                                ...           9 months ago
  • 2.0.15                                ...           9 months ago
  • 2.0.14                                ...           9 months ago
  • 2.0.12                                ...           10 months ago
  • 2.0.11                                ...           10 months ago
  • 2.0.10                                ...           10 months ago
  • 2.0.9                                ...           10 months ago
  • 2.0.8                                ...           10 months ago
  • 1.3.12-V1-84                                ...           a year ago
  • 1.3.12-V1-83                                ...           a year ago
  • 1.3.12-V1-82                                ...           a year ago
  • 1.3.12-V1-81                                ...           a year ago
  • 1.3.12-V1-80                                ...           a year ago
  • 1.3.12-V1-79                                ...           a year ago
  • 1.3.12-V1-78                                ...           a year ago
  • 2.0.7                                ...           a year ago
  • 2.0.6                                ...           a year ago
  • 2.0.5                                ...           a year ago
  • 2.0.4                                ...           a year ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.5.4                                ...           a year ago
  • 1.5.3                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.18                                ...           a year ago
  • 1.3.17                                ...           a year ago
  • 1.3.12-V1-77                                ...           a year ago
  • 1.3.12-V1-76                                ...           a year ago
  • 1.3.16                                ...           a year ago
  • 1.3.15                                ...           a year ago
  • 1.3.14                                ...           a year ago
  • 1.3.13                                ...           a year ago
  • 1.3.12-V1-75                                ...           a year ago
  • 1.3.12-V1-74                                ...           a year ago
  • 1.3.12-V1-73                                ...           a year ago
  • 1.3.12-V1-72                                ...           a year ago
  • 1.3.12-V1-71                                ...           a year ago
  • 1.3.12-V1-70                                ...           a year ago
  • 1.3.12-V1-69                                ...           a year ago
  • 1.3.12-V1-68                                ...           a year ago
  • 1.3.12-V1-67                                ...           a year ago
  • 1.3.12-V1-66                                ...           a year ago
  • 1.3.12-V1-65                                ...           a year ago
  • 1.3.12-V1-64                                ...           a year ago
  • 1.3.12-V1-63                                ...           a year ago
  • 1.3.12-V1-61                                ...           a year ago
  • 1.3.12-V1-60                                ...           a year ago
  • 1.3.12-V1-59                                ...           a year ago
  • 1.3.12-V1-58                                ...           a year ago
  • 1.3.12-V1-57                                ...           a year ago
  • 1.3.12-V1-56                                ...           a year ago
  • 1.3.12-V1-55                                ...           a year ago
  • 1.3.12-V1-54                                ...           a year ago
  • 1.3.12-V1-52                                ...           a year ago
  • 1.3.12-V1-51                                ...           a year ago
  • 1.3.12-V1-50                                ...           a year ago
  • 1.3.12-V1-49                                ...           a year ago
  • 1.3.12-V1-48                                ...           a year ago
  • 1.3.12-V1-47                                ...           a year ago
  • 1.3.12-V1-46                                ...           a year ago
  • 1.3.12-V1-45                                ...           a year ago
  • 1.3.12-V1-43                                ...           2 years ago
  • 1.3.12-V1-42                                ...           2 years ago
  • 1.3.12-V1-41                                ...           2 years ago
  • 1.3.12-V1-40                                ...           2 years ago
  • 1.3.12-V1-39                                ...           2 years ago
  • 1.3.12-V1-38                                ...           2 years ago
  • 1.3.12-V1-37                                ...           2 years ago
  • 1.3.12-V1-36                                ...           2 years ago
  • 1.3.12-V1-35                                ...           2 years ago
  • 1.3.12-V1-34                                ...           2 years ago
  • 1.3.12-V1-33                                ...           2 years ago
  • 1.3.12-V1-32                                ...           2 years ago
  • 1.3.12-V1-31                                ...           2 years ago
  • 1.3.12-V1-30                                ...           2 years ago
  • 1.3.12-V1-29                                ...           2 years ago
  • 1.3.12-V1-28                                ...           2 years ago
  • 1.3.12-V1-27                                ...           2 years ago
  • 1.3.12-V1-26                                ...           2 years ago
  • 1.3.12-V1-25                                ...           2 years ago
  • 1.3.12-V1-24                                ...           2 years ago
  • 1.3.12-V1-23                                ...           2 years ago
  • 1.3.12-V1-22                                ...           2 years ago
  • 1.3.12-V1-21                                ...           2 years ago
  • 1.3.12-V1-20                                ...           2 years ago
  • 1.3.12-V1-19                                ...           2 years ago
  • 1.3.12-V1-18                                ...           2 years ago
  • 1.3.12-V1-17                                ...           2 years ago
  • 1.3.12-V1-16                                ...           2 years ago
  • 1.3.12-V1-15                                ...           2 years ago
  • 1.3.12-V1-14                                ...           2 years ago
  • 1.3.12-V1-13                                ...           2 years ago
  • 1.3.12-V1-12                                ...           2 years ago
  • 1.3.12-V1-11                                ...           2 years ago
  • 1.3.12-V1-10                                ...           2 years ago
  • 1.3.12-V1-09                                ...           2 years ago
  • 1.3.12-V1-08                                ...           2 years ago
  • 1.3.12-V1-07                                ...           2 years ago
  • 1.3.12-V1-06                                ...           2 years ago
  • 1.3.12-V1-05                                ...           2 years ago
  • 1.3.12-V1-04                                ...           2 years ago
  • 1.3.12-V1-03                                ...           2 years ago
  • 1.3.12-V1-02                                ...           2 years ago
  • 1.3.12-V1-01                                ...           2 years ago
  • 1.3.12                                ...           2 years ago
  • 1.3.11                                ...           2 years ago
  • 1.3.10                                ...           2 years ago
  • 1.3.9                                ...           2 years ago
  • 1.3.8                                ...           2 years ago
  • 1.3.7                                ...           2 years ago
  • 1.3.6                                ...           2 years ago
  • 1.3.5                                ...           2 years ago
  • 1.3.4                                ...           2 years ago
  • 1.3.3                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.11                                ...           2 years ago
  • 1.2.10                                ...           2 years ago
  • 1.2.9                                ...           2 years ago
  • 1.2.8                                ...           2 years ago
  • 1.2.7                                ...           2 years ago
  • 1.2.6                                ...           2 years ago
  • 1.2.5                                ...           2 years ago
  • 1.2.4                                ...           2 years ago
  • 1.2.3                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.8                                ...           2 years ago
  • 1.1.7                                ...           2 years ago
  • 1.1.6                                ...           2 years ago
  • 1.1.5                                ...           2 years ago
  • 1.1.4                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.21                                ...           2 years ago
  • 0.0.20                                ...           2 years ago
  • 0.0.19                                ...           2 years ago
  • 0.0.18                                ...           2 years ago
  • 0.0.17                                ...           2 years ago
  • 0.0.16                                ...           2 years ago
  • 0.0.15                                ...           2 years ago
  • 0.0.14                                ...           2 years ago
  • 0.0.13                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 387
Last Day 0
Last Week 287
Last Month 76

Copyright 2014 - 2016 © taobao.org |