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

How do users authenticate to services #23

Open
0o-de-lally opened this issue May 15, 2016 · 1 comment
Open

How do users authenticate to services #23

0o-de-lally opened this issue May 15, 2016 · 1 comment

Comments

@0o-de-lally
Copy link

Thanks for a great library. I can't seem to find any info on authentication, is this supported?

As an example, I'm trying to implement a basic form post with user authentication for this service:
https://documentation.mailgun.com/api-sending.html#examples

Are there any docs or examples about how to use the curl equivalent of

curl -s --user 'api:YOUR_API_KEY' https://domain.com -F from='User <mailgun@YOUR_DOMAIN_NAME>'

@ForbesLindesay
Copy link
Member

Just pass the "authorization" header as an option:

{authorization: 'Basic ' + Buffer(username + ':' + password).toString('base64')}

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

No branches or pull requests

2 participants