本文整理汇总了TypeScript中helper/oauth-helper.OAuthHelper.showOAuthPopup方法的典型用法代码示例。如果您正苦于以下问题:TypeScript OAuthHelper.showOAuthPopup方法的具体用法?TypeScript OAuthHelper.showOAuthPopup怎么用?TypeScript OAuthHelper.showOAuthPopup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper/oauth-helper.OAuthHelper
的用法示例。
在下文中一共展示了OAuthHelper.showOAuthPopup方法的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;
}