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 to do Authentication with Sharpipp PrintJobRequest #13

Open
jkvaultex opened this issue Aug 4, 2022 · 1 comment
Open

How to do Authentication with Sharpipp PrintJobRequest #13

jkvaultex opened this issue Aug 4, 2022 · 1 comment

Comments

@jkvaultex
Copy link

Hi Team,

we are trying to send print job request to the IPP printer hosted in IIS wit basic authentication.
So we are expected to send a Authorization header with the print request.

Could you please guide us how we can do this ?

Thanks,
Joby

@danielklecha
Copy link

I cannot test it, but it should be possible to set headers in HttpClient.

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes($"{yourusername}:{yourpwd}")));
var client = new SharpIppClient(httpClient);
await client.PrintJobAsync( printJobRequest );

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