Skip to content

Usage with Google API's and firebase #21

Answered by ap-1
kpoman asked this question in Q&A
Discussion options

You must be logged in to vote

As @kasvith instructed, you can use a custom button using useTokenClient to specify the calendar scope. Then, authenticate to Firebase using GoogleAuthProvider.credential:

const handleOnSuccess = (response: AuthCodeFlowSuccessResponse) => {
    const credential = GoogleAuthProvider.credential(null, response.access_token);
    const result = await signInWithCredential(getAuth(), credential);

    // then do what you want with the result e.g.
    const user = result.user;
};

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
11 replies
@kpoman
Comment options

@kasvith
Comment options

@kasvith
Comment options

@ap-1
Comment options

@kasvith
Comment options

Comment options

You must be logged in to vote
1 reply
@kasvith
Comment options

Answer selected by kasvith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #20 on September 27, 2022 04:47.