Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Retrieve "real" email of user when logging in to a brand account with the youtube.readonly scope provided?

$
0
0

I am currently building a login system for an application I am developing, using YouTube accounts via Google Oauth for login with Firebase. However, when I add the youtube readonly scope:

import {getAuth, signInWithPopup} from "firebase/auth";async function loginGoogle(){    const auth = getAuth();    const provider = new GoogleAuthProvider();    provider.addScope('https://www.googleapis.com/auth/youtube.readonly');    const result = await signInWithPopup(auth,provider);    console.log(result);}loginGoogle();

When I look at the output of my result, I will find an email such as:

email: "myYouTubeName-1234@pages.plusgoogle.com"

When in reality, I want the email of the gmail account that I logged in with instead, such as SomeOtherName@gmail.com.

This is only an issue when logging in to brand accounts.

Is there an additional Google endpoint that I can pass my accessToken to that will give me the proper email? Or how can I receive the "parent" email of a brand account when logging in with the youtube.readonly scope?

Thanks!


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>