ivs-oauth-module
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Description

An angular2 module that provides a default implementation for oauth2 authentication.

Usage

Inside your root appmodule Import the OAuthModule as follows:

import { OAuthModule } from 'ivs-oauth-module';

@NgModule({
  declarations: [
    ..
  ],
  imports: [
    ...
    OAuthModule.forRoot()
  ],
  providers: [
  ],
  bootstrap: [...]
})
export class AppModule { }

Now you can use the OAuthService inside your appComponent:

import { OAuthService } from 'ivs-oauth-module';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app works!';

  constructor(private _oAuthService: OAuthService) {
    _oAuthService.init({
      authorizationEndpoint: 'http://ivs-gui-iam.ivs-gui-iam.rws.ictu:8080/ivs-gui-iam/realms/ivs/protocol/openid-connect/auth',
      endSessionEndpoint: 'http://ivs-gui-iam.ivs-gui-iam.rws.ictu:8080/ivs-gui-iam/realms/ivs/protocol/openid-connect/logout',
      realm: 'ivs',
      clientId: 'ivs-gui',
      redirectUri: location.href,
      responseType: 'code token',
      scope: ''
    });
    
    _oAuthService.login();
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i ivs-oauth-module

Weekly Downloads

2

Version

1.0.0

License

none

Last publish

Collaborators

  • jodek