Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 84ef4b7

Browse files
committed
Fixes NetworkCredentialApplicator on first request.
Fixes #204
1 parent b17fb1c commit 84ef4b7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientCredentialApplicator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ public override void ApplyClientCredential(string clientIdentifier, HttpWebReque
135135
clientIdentifier);
136136
}
137137

138-
request.Credentials = this.credential ?? new NetworkCredential(clientIdentifier, this.clientSecret);
138+
// HttpWebRequest ignores the Credentials property until the remote server returns a 401 Unauthorized.
139+
// So we also set the HTTP Authorization request header directly.
140+
OAuthUtilities.ApplyHttpBasicAuth(request.Headers, clientIdentifier, this.clientSecret);
139141
}
140142
}
141143
}

0 commit comments

Comments
 (0)