Open Advaita151 opened 1 year ago
import com.google.firebase.FirebaseApp; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseAuthProvider; import com.google.firebase.auth.FirebaseToken; import com.google.firebase.auth.GoogleAuthProvider;
// Initialize FirebaseApp (Make sure you have already set up your Firebase project) FirebaseApp.initializeApp();
// Get the FirebaseAuth instance FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
// Generate a Google authentication provider FirebaseAuthProvider firebaseAuthProvider = GoogleAuthProvider.getInstance();
// Authenticate with Firebase using Google credentials
String idToken = "
This would be great if achieved. I am assigning you this issue, goodluck!
Thanks a lot i will try my best
On Mon, 22 May 2023, 22:09 Roshan George, @.***> wrote:
This would be great if achieved. I am assigning you this issue, goodluck!
— Reply to this email directly, view it on GitHub https://github.com/roshangeorge97/Edunity/issues/9#issuecomment-1557551012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZCARFS5WVJ5VA3LWY7S7TTXHOJDNANCNFSM6AAAAAAYKRJ3VM . You are receiving this because you commented.Message ID: @.***>
This would be great if achieved. I am assigning you this issue, goodluck!
Thanks a lot , I will complete it asap
dependencies { // Firebase Authentication implementation 'com.google.firebase:firebase-auth:21.0.1' // Other Firebase SDKs you may need // implementation 'com.google.firebase:firebase-database:21.0.1' // implementation 'com.google.firebase:firebase-storage:21.0.1' // ... }
wondering If you could set up edunity locally, and give a fix by adding the snippet to the Auth component we could consider for a merge.
// Import the necessary Firebase modules import firebase from 'firebase/app'; import 'firebase/auth';
// Initialize Firebase (Make sure you have already set up your Firebase project) const firebaseConfig = { // Your Firebase config object goes here }; firebase.initializeApp(firebaseConfig);
// Get the Firebase auth instance const auth = firebase.auth();
// Create a Google authentication provider const provider = new firebase.auth.GoogleAuthProvider();
// Function to handle Google sign-in function signInWithGoogle() { auth.signInWithPopup(provider) .then((result) => { // Successful authentication const user = result.user; console.log('Authenticated user:', user); }) .catch((error) => { // Failed authentication console.log('Authentication failed:', error.message); }); }
// Call the signInWithGoogle function when the login button is clicked const loginButton = document.getElementById('login-button'); loginButton.addEventListener('click', signInWithGoogle);
Current Behavior
User has to enter their email and password manually
Desired Behavior
Firebase provides google authentication which would be easier to login. I would like to work on this issue as GSSOC'23 Contributor. Thank you !
Could you please assign this issue to me?
Screenshots / Mockups