An angular2 module that provides a default implementation for oauth2 authentication.
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();
}
}