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 can I do a Basic Auth in Web3? #84

Open
DwCleb opened this issue Aug 13, 2020 · 1 comment
Open

How can I do a Basic Auth in Web3? #84

DwCleb opened this issue Aug 13, 2020 · 1 comment

Comments

@DwCleb
Copy link

DwCleb commented Aug 13, 2020

I need apply user and password in some endpoints in my request.

How can I pass a user and password in this request?

@koraykoska
Copy link
Member

You can create your own Web3Provider. Have a look at https://github.com/Boilertalk/Web3.swift/blob/master/Sources/FoundationHTTP/Web3HttpProvider.swift for an example. You can pretty much copy & paste it and add the Basic Auth for URLRequest.

Then you would only have to provide your own Provider to the Web3 initializer here:

https://github.com/Boilertalk/Web3.swift/blob/master/Sources/Core/Web3/Web3.swift#L52

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