Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auth): add signInWithCustomToken method #577

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dehypnosis
Copy link

@dehypnosis dehypnosis commented Aug 12, 2023

Hi Team,

This patch adds a public method to call an API:

Sorry if this PR is not appropriate in contribution process.

Background

Actually, I was using this REST API by calling that with API Key via separated HTTP client as the document described.

But recently, I had to turn Firebase AppCheck for Authentication due to SMS fraud issue. With AppCheck enabled, this API stops to work with "Invalid App Check Token" error in my server. I found no way to embed AppCheck header in internal call. So I forked and added this API call method to firebase admin to make it work with service account credentials. And it resolves the issue.

Please check this issue.
Thanks.

@google-cla
Copy link

google-cla bot commented Aug 12, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@dehypnosis dehypnosis closed this Aug 12, 2023
@dehypnosis dehypnosis reopened this Aug 12, 2023
Copy link

@nilskch nilskch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a contributor, but wanted to mention that the return statement is not necessary.

}
if _, err = c.httpClient.DoAndUnmarshal(ctx, req, resp); err != nil {
resp = nil
return
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the return statement here is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants