本文整理匯總了TypeScript中helper/oauth-helper.OAuthHelper類的典型用法代碼示例。如果您正苦於以下問題:TypeScript OAuthHelper類的具體用法?TypeScript OAuthHelper怎麽用?TypeScript OAuthHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了OAuthHelper類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: loginTwitter
public async loginTwitter() : Promise<void> {
let loginUrl = await this.logbookApi.authenticationApi.getTwitterLoginUrl(config.socialLoginRedirectUrl);
let loggedInUrl = await this.oauthHelper.showOAuthPopup("Twitter", loginUrl.url, config.socialLoginRedirectUrl);
let verifier = this.urlHelper.getParameter(loggedInUrl, "oauth_verifier");
let jsonWebToken = await this.logbookApi.authenticationApi.loginTwitter(verifier, loginUrl.payload);
this.token = jsonWebToken;
}
示例2: loginGoogle
public async loginGoogle() : Promise<void> {
let loginUrl = await this.logbookApi.authenticationApi.getGoogleLoginUrl(config.socialLoginRedirectUrl);
let loggedInUrl = await this.oauthHelper.showOAuthPopup("Google", loginUrl, config.socialLoginRedirectUrl);
let code = this.urlHelper.getParameter(loggedInUrl, "code");
let jsonWebToken = await this.logbookApi.authenticationApi.loginGoogle(code, config.socialLoginRedirectUrl);
this.token = jsonWebToken;
}