New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

innotec-auth-plugin

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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:

0.0.22
latest
npm
Version published
Maintainers
1
Created
Source

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 (Github, 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

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 moduleoptions Service:

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

.
.

export class YoUrClAsSs {
  constructor (private options: ModuleOptions) {

  }

  public yourService() {
    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
      endpoint: 'live',                     // Switch for the endpoints. Sandbox is comming soon. live is default.
      userregisterurl: 'url',               // Defines the url where the user can be register... Default is 'https://app.v2.werbasinnotec.com'
      closeable: true                       // Boolen to define if the loginwindow is closeable
    };

    this.options.set(options);
  }
}
Second

At next you can import the loginfield in your base template:

<login-field [open]='!isLoggedIn'></login-field>

The loginfield is hidden in default-mode. You can open the loginfield with the open property in this element. If the open property true, the login will displayed as fixed container.

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 functions

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

(C) 2017 - Werbas AG / Werbas Innotec GmbH All rights reserverd!

Keywords

angular2

FAQs

Package last updated on 04 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts