Click here to Skip to main content
14,543,933 members
   

C#

 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 4:36
MemberMember 114033049-Mar-20 4:36 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming9-Mar-20 8:36
mveRichard Deeming9-Mar-20 8:36 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 9:41
MemberMember 114033049-Mar-20 9:41 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming9-Mar-20 9:53
mveRichard Deeming9-Mar-20 9:53 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 11:45
MemberMember 114033049-Mar-20 11:45 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming10-Mar-20 0:14
mveRichard Deeming10-Mar-20 0:14 
GeneralRe: How do I make table data red in <td>? Pin
Member 1140330412-Mar-20 4:08
MemberMember 1140330412-Mar-20 4:08 
QuestionHow to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 0:27
MemberS p k 5214-Mar-20 0:27 
Hi Experts,

I have a requirement to access a connected printer device through their embedded web server.
The device had an option to secure its details using username and password.
Once it is set, we can only communicate through "https" to that device.
Also there is windows credentials popup will come from UWP app once we initiate communication through https and wait for the user to enter the correct username and password as in web server.

My requirement is we need to pass those credentials as authorization header for a POST request to that device.

eg:-
Authorization: Basic YWRtaW46MTIzNDU2Nzg5


How to access those Windows credentials in UWP app. Without this authorization token, i am getting HTTP:401 unauthorized error for the POST request.


Please guide me to resolve this issue.


What I have tried:

I tried hard coding the username and password entered in the web server.

var username = usrName;
                   var password = pwd;
                   var base64String = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}"));
                   _httpClient.AuthorizationHeader = new KeyValuePair<string, string>("Basic", base64String);


then in this case the POST request is successful.

Also tried the same in a separate test application. In that case after entering the credentials in the windows credentials popup the same POST request is again sending automatically with those credentials as Basic auth token.

Regards
Spk

AnswerRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
Richard MacCutchan4-Mar-20 0:37
mveRichard MacCutchan4-Mar-20 0:37 
GeneralRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 2:03
MemberS p k 5214-Mar-20 2:03 
Questionforeach loop behavior C# Pin
picasso22-Mar-20 18:55
Memberpicasso22-Mar-20 18:55 
AnswerRe: foreach loop behavior C# Pin
Pete O'Hanlon2-Mar-20 20:17
subeditorPete O'Hanlon2-Mar-20 20:17 
AnswerRe: foreach loop behavior C# Pin
OriginalGriff2-Mar-20 20:23
mveOriginalGriff2-Mar-20 20:23 
AnswerRe: foreach loop behavior C# Pin
lmoelleb3-Mar-20 23:01
Memberlmoelleb3-Mar-20 23:01 
QuestionIgroupping with Parallel Pin
Member 110035101-Mar-20 6:58
MemberMember 110035101-Mar-20 6:58 
AnswerRe: Igroupping with Parallel Pin
Dave Kreskowiak1-Mar-20 7:39
mveDave Kreskowiak1-Mar-20 7:39 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 7:46
MemberMember 110035101-Mar-20 7:46 
GeneralRe: Igroupping with Parallel Pin
Dave Kreskowiak1-Mar-20 7:50
mveDave Kreskowiak1-Mar-20 7:50 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 18:28
MemberMember 110035101-Mar-20 18:28 
AnswerRe: Igroupping with Parallel Pin
Luc Pattyn1-Mar-20 9:04
sitebuilderLuc Pattyn1-Mar-20 9:04 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 18:36
MemberMember 110035101-Mar-20 18:36 
GeneralRe: Igroupping with Parallel Pin
Pete O'Hanlon1-Mar-20 21:21
subeditorPete O'Hanlon1-Mar-20 21:21 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 22:17
MemberMember 110035101-Mar-20 22:17 
GeneralRe: Igroupping with Parallel Pin
Pete O'Hanlon1-Mar-20 22:42
subeditorPete O'Hanlon1-Mar-20 22:42 
GeneralRe: Igroupping with Parallel Pin
Richard Deeming1-Mar-20 23:57
mveRichard Deeming1-Mar-20 23:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.