This repository has been archived by the owner on Oct 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from rhelmer/google-auth-web-sample
pull in sample google auth integration code
- Loading branch information
Showing
3 changed files
with
62 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,54 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
|
||
<title>Rally: Put your data to work for a better internet</title> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
<meta name="google-signin-scope" content="profile email"> | ||
<meta name="google-signin-client_id" | ||
content="872283440703-nakr30t7ro2da7do976tkfm19v63mfn8.apps.googleusercontent.com"> | ||
<script src="https://apis.google.com/js/platform.js" async defer></script> | ||
|
||
<link rel="icon" href="img/rally-favicon.svg" /> | ||
<link rel="stylesheet" href="build/protocol.css" /> | ||
<link rel="stylesheet" href="build/protocol-extra.css" /> | ||
<link rel="stylesheet" href="rally.css" /> | ||
<link rel="stylesheet" href="tokens.css" /> | ||
<link rel="stylesheet" href="build/bundle.css" /> | ||
<title>Rally: Put your data to work for a better internet</title> | ||
|
||
<script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-app.js"></script> | ||
<script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-firestore.js"></script> | ||
<script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-auth.js"></script> | ||
<link rel="icon" href="img/rally-favicon.svg" /> | ||
<link rel="stylesheet" href="build/protocol.css" /> | ||
<link rel="stylesheet" href="build/protocol-extra.css" /> | ||
<link rel="stylesheet" href="rally.css" /> | ||
<link rel="stylesheet" href="tokens.css" /> | ||
<link rel="stylesheet" href="build/bundle.css" /> | ||
|
||
<script defer src="build/bundle.js"></script> | ||
</head> | ||
<script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-app.js"></script> | ||
<script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-firestore.js"></script> | ||
<script src="https://www.gstatic.com/firebasejs/8.6.7/firebase-auth.js"></script> | ||
|
||
<body></body> | ||
</html> | ||
<script defer src="build/bundle.js"></script> | ||
|
||
<div class="g-signin2 social_signin" data-onsuccess="onSignIn"></div> | ||
|
||
|
||
<script> | ||
function onSignIn(googleUser) { | ||
// Useful data for your client-side scripts: | ||
var profile = googleUser.getBasicProfile(); | ||
console.log("ID: " + profile.getId()); // Don't send this directly to your server! | ||
console.log('Full Name: ' + profile.getName()); | ||
console.log('Given Name: ' + profile.getGivenName()); | ||
console.log('Family Name: ' + profile.getFamilyName()); | ||
console.log("Image URL: " + profile.getImageUrl()); | ||
console.log("Email: " + profile.getEmail()); | ||
|
||
// The ID token you need to pass to your backend: | ||
var id_token = googleUser.getAuthResponse().id_token; | ||
console.log("ID Token: " + id_token); | ||
|
||
for (const studyId of ["maoohlacnogbjgacnnoajgljfcdbdocb"]) { | ||
chrome.runtime.sendMessage(studyId, id_token); | ||
} | ||
} | ||
</script> | ||
</head> | ||
|
||
<body></body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters