0.1.5 • Published 4 years ago

usb-auth-lib v0.1.5

Weekly downloads
48
License
-
Repository
-
Last release
4 years ago

UsbAuthLib

This library was generated with Angular CLI version 7.2.0.

Installation

Usage

Add following in app.module.ts :

const options: ModuleOptionsInterface = {
  link: 'http://link',
  port: 88888,
  groupDefinition: [{
    groupName: 'isAdmin',
    adValues: ['anAdminGroup']
  }, {
    groupName: 'isUser',
    adValues: ['anAdGroups', 'anotherAdGroup']
  }]
};

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    UsbAuthLibModule.forRoot(options)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'auth-tester';
  constructor(private usbAuthLibService: UsbAuthLibService) {
    this.usbAuthLibService.isMemberOf('isAdmin')
      .subscribe((check) => console.log(check));

    this.usbAuthLibService.getToken()
      .subscribe((token) => console.log(token));
  }
}

Code scaffolding

Run ng generate component component-name --project usb-auth-lib to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project usb-auth-lib.

Note: Don't forget to add --project usb-auth-lib or else it will be added to the default project in your angular.json file.

Build

Run ng build usb-auth-lib to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build usb-auth-lib, go to the dist folder cd dist/usb-auth-lib and run npm publish.

Running unit tests

Run ng test usb-auth-lib to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago