text: // This snippet file was generated by processing the source file:
  // ./auth-next/microsoft-oauth.js
  //
  // To make edits to the snippets in this file, please edit the source
  
  // [START auth_msft_signin_popup_modular]
  import { getAuth, signInWithPopup, OAuthProvider } from "firebase/auth";
  
  const auth = getAuth(firebaseApp);
  signInWithPopup(auth, provider)
    .then((result) => {
      // User is signed in.
      // IdP data available in result.additionalUserInfo.profile.
  
      // Get the OAuth access token and ID Token
      const credential = OAuthProvider.credentialFromResult(result);
      const accessToken = credential.accessToken;
      const idToken = credential.idToken;
    })
    .catch((error) => {
      // Handle error.
    });
  // [END auth_msft_signin_popup_modular]