- Du hast kein Konto? Jetzt registrieren! »
SnippetDK1
import { TwitterAuthProvider } from "firebase/auth";
const provider = new TwitterAuthProvider();
provider.setCustomParameters({
'lang': 'de'
});
import { getAuth, signInWithPopup, TwitterAuthProvider } from "firebase/auth";
const auth = getAuth();
signInWithPopup(auth, provider)
.then((result) => {
// This gives you a the Twitter OAuth 1.0 Access Token and Secret.
// You can use these server side with your app's credentials to access the Twitter API.
const credential = TwitterAuthProvider.credentialFromResult(result);
const token = credential.accessToken;
const secret = credential.secret;
// The signed-in user info.
const user = result.user;
// IdP data available using getAdditionalUserInfo(result)
// ...
}).catch((error) => {
// Handle Errors here.
const errorCode = error.code;
const errorMessage = error.message;
// The email of the user's account used.
const email = error.customData.email;
// The AuthCredential type that was used.
const credential = TwitterAuthProvider.credentialFromError(error);
// ...
});
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/12.14.0/firebase-app.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyBUlc0B1YOUH0uoyqz1gHSsFTy8t8cAlas",
authDomain: "windy-semiotics-375419.firebaseapp.com",
projectId: "windy-semiotics-375419",
storageBucket: "windy-semiotics-375419.firebasestorage.app",
messagingSenderId: "865368300179",
appId: "1:865368300179:web:0b1c9c33fb63a8133ecb66"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
</script> ___________________________________________________________________________________________________________________________________________________ |
___________________________________________________________________________________________________________________________________________________