constructor(tokens) { super(); var o2c = new OAuth2(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL); o2c.setCredentials(tokens); this.oauth2Client = o2c; }
constructor(googleId, hostedDomain) { this.googleId = googleId; this.hostedDomain = hostedDomain; this.auth = new GoogleAuth; // eslint-disable-line new-parens this.client = new this.auth.OAuth2(googleId, '', ''); this.verifyIdTokenPromise = Utils.promisify(this.client.verifyIdToken, 1, this.client); }
function kakaoOAuth2() { var appId = keyConverter(process.env.KAKAO_RESTKEY); var secret = keyConverter(process.env.KAKAO_SECRETS); return new _oauth.OAuth2(appId, secret, "", "https://kauth.kakao.com/oauth/authorize", "https://kauth.kakao.com/oauth/token", null); }
describe('OAuth2 interface', function(){ it('should be an interface only (can\'t create instance)', function() { try { oauth2 = new OAuth2(FORGE_CLIENT_ID, FORGE_CLIENT_SECRET, ['data:read', 'data:write']); } catch(e) { expect(e).to.eql(new Error('Your OAuth2 object is missing the "authentication" property')); } }); });
function authorize(callback) { var clientSecret = secret.google.clientSecret; var clientId = secret.google.clientID; var auth = new Googleauth(); var oauth2Client = new auth.OAuth2(clientId, clientSecret); }
/** * Get Oauth2 Client */ const getOauth2Client = () => { const content = fs.readFileSync(conf.CRED_PATH); const { client_id: clientId, client_secret: clientSecret, redirect_uris: redirectUris } = JSON.parse(content).installed; return new google.auth.OAuth2(clientId, clientSecret, redirectUris[0]); }
function ytAuth() { var OAuth2 = google.auth.OAuth2; var credentials = JSON.parse(process.env.YT_SECRET); var clientSecret = credentials.installed.client_secret; var clientId = credentials.installed.client_id; var redirectUrl = credentials.installed.redirect_uris[0]; auth = new OAuth2(clientId, clientSecret, redirectUrl); auth.credentials = JSON.parse(process.env.YT_TOKEN); service = google.youtube({ version: 'v3', 'auth': auth }); }
constructor() { super(); this.OAuth2Client = new OAuth2( config.auth.key.client_id, config.auth.key.client_secret, config.auth.key.redirect_uris[0], ); this.inProcess = false; }
_createAuthClient(credentials) { let oauth2Client = new auth.OAuth2(this.appCredentials.id, this.appCredentials.secret, this.appCredentials.redirectUrl); if (credentials) { oauth2Client.setCredentials(credentials); } return oauth2Client; }
function getAuthenticationUrl() { var client = new google.auth.OAuth2( config.oauth2.clientId, config.oauth2.clientSecret, config.oauth2.redirectUrl ); // Use 'profile' scope to authorize fetching the user's profile return client.generateAuthUrl({ scope: ['profile'] }); }
function fbOAuth2() { var appId = keyConverter(process.env.FB_APPIDS); var secret = keyConverter(process.env.FB_SECRETS); return new _oauth.OAuth2(appId, secret, "", "https://www.facebook.com/dialog/oauth", "https://graph.facebook.com/oauth/access_token", null); }
function naverOAuth2() { var appId = keyConverter(process.env.NAVER_APPIDS); var secret = keyConverter(process.env.NAVER_SECRETS); return new _oauth.OAuth2(appId, secret, "", "https://nid.naver.com/oauth2.0/authorize", "https://nid.naver.com/oauth2.0/token", null); }
function daumOAuth2() { var appId = keyConverter(process.env.DAUM_APPIDS); var secret = keyConverter(process.env.DAUM_SECRETS); return new _oauth.OAuth2(appId, secret, "", "https://apis.daum.net/oauth2/authorize", "https://apis.daum.net/oauth2/token", null); }
function googleOAuth2() { var appId = keyConverter(process.env.GOOGLE_APPIDS); var secret = keyConverter(process.env.GOOGLE_SECRETS); return new _oauth.OAuth2(appId, secret, "", "https://accounts.google.com/o/oauth2/v2/auth", "https://www.googleapis.com/oauth2/v4/token", null); }
function instaOAuth2() { const appId = keyConverter(process.env.INSTA_APPIDS); const secret = keyConverter(process.env.INSTA_SECRETS); return new OAuth2( appId, secret, "", "https://api.instagram.com/oauth/authorize/", "https://api.instagram.com/oauth/access_token", null ); }