# UsbAuthLib

This library was generated with [Angular CLI](https://github.com/angular/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](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
