本文整理汇总了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;
}