本文整理匯總了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
}))