本文整理汇总了TypeScript中@okta/okta-angular.OktaAuthService类的典型用法代码示例。如果您正苦于以下问题:TypeScript OktaAuthService类的具体用法?TypeScript OktaAuthService怎么用?TypeScript OktaAuthService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OktaAuthService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: intercept
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
// Only add to localhost requests since Giphy's API fails when the request include a token
if (request.url.indexOf('localhost') > -1) {
request = request.clone({
setHeaders: {
Authorization: `Bearer ${this.oktaAuth.getAccessToken().accessToken}`
}
});
}
return next.handle(request);
}
示例2: logout
logout() {
this.oktaAuth.logout('/');
}
示例3: ngOnInit
async ngOnInit() {
this.isAuthenticated = await this.oktaAuth.isAuthenticated();
}
示例4:
.then(res => this.okta.loginRedirect('/', {
sessionToken: res.sessionToken
}))