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 helpers to generate various authentication header types #4

Closed
arunoda opened this issue Jan 4, 2021 · 6 comments
Closed

Add helpers to generate various authentication header types #4

arunoda opened this issue Jan 4, 2021 · 6 comments

Comments

@arunoda
Copy link
Collaborator

arunoda commented Jan 4, 2021

Add support for:

  • Basic Auth
  • Bearer Auth (OAuth)
@juninholiveira
Copy link

juninholiveira commented Jul 27, 2021

I'm trying to make a POST request which requires a Basic Auth authorization. But it's not working, I wonder if it's impossible at this moment. Do you know what could be? Has something to do with the support you intend to implement on this Issue?
Captura de tela 2021-07-26 220939
-Edit- I get the 401 status code. The exactly same authorization header on Postman works fine.

@arunoda
Copy link
Collaborator Author

arunoda commented Jul 27, 2021

Hey, just appedning "Username:Password" is not enough. You need to encode that as Base64. That was the missing part here.
See: https://en.wikipedia.org/wiki/Basic_access_authentication#Protocol

I am planning to make some updates to Fetch this week. I will make sure to do this too.

@juninholiveira
Copy link

juninholiveira commented Jul 27, 2021

Thank you! I would appreciate very much if you do this update. I bought you plugin because it's much more well documented than the other one on the marketplace. But only this issue is preventing me to achieve my goal.

But actually, what is your plan to adress this issue? Do you intend to create a Base64 Encode node so we can manually encode our string before adding it to the array? Or something else?

-Edit-
I was able to get it working! For people that might have the same problem on the future: You have to encode JUST the username:password to Base64, then you add the string "Basic " (atention to the space) before the encoded string. After that, you do exactly what is told on the examples of this plugin to add custom Headers.

The problem is: I was only able to encode the string to Base64 using a node from the competitor REST plugin. Now I will wait for Arunoda to create some solution to encode to Base64 on this plugin. It would be better to have everything needded on just one plugin.

@arunoda
Copy link
Collaborator Author

arunoda commented Jul 28, 2021

@juninholiveira I will create a simple helper function to add the username & password & it'll create the whole auth header. I will ping you when it's available on the marketplace.

@juninholiveira
Copy link

@arunoda Amazing! Better than what I imagined. I will wait patiently.

@arunoda
Copy link
Collaborator Author

arunoda commented Jul 31, 2021

@juninholiveira I just added support for this. Will available on the marketplace soon.

@arunoda arunoda closed this as completed Jul 31, 2021
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