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

Add option to pass access_token in Authorization header instead of query parameter #205

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

sbellity
Copy link
Contributor

@sbellity sbellity commented Feb 27, 2023

This proposal allows to pass the access_token as Authorization header to FB api instead of query parameter.
Does not change the current behavior which is still the default, but adds a UseAuthorizationHeader on the session to enable this feature.

example use:

func newFacebookSession(ctx context.Context, accessToken string) facebook.Session {
        session := facebook.Session{}.WithContext(ctx)
        session.SetAccessToken(accessToken)
	session.UseAuthorizationHeader()
        return session
}

@huandu huandu merged commit 004c156 into huandu:master Feb 27, 2023
@huandu
Copy link
Owner

huandu commented Feb 27, 2023

LGTM. Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants