Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
Update for #15 and #14 - correct username and update "getAuthOTP" fun…
Browse files Browse the repository at this point in the history
…ction.
  • Loading branch information
sbidy committed Dec 21, 2018
1 parent 48ea1c6 commit b9770a1
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions privacyIDEAADFSProvider/OTPprovider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,20 @@ public bool getAuthOTP(string OTPuser, string OTPpin, string realm, string trans
{
// check if otp contains only numbers
// Bug #10 - beaks the OTP+PIN combination - removed
//if (!IsDigitsOnly(OTPpin)) return false;
//if (!IsDigitsOnly(OTPpin)) return false;

NameValueCollection request_header = new NameValueCollection(){
{"pass", OTPpin},
{"user", OTPuser},
{"realm", realm}
};
// add transaction id if challenge request
if (!string.IsNullOrEmpty(transaction_id)) request_header.Add("transaction_id", transaction_id);
// send reqeust
using (WebClient client = new WebClient())
{
byte[] response =
client.UploadValues(URL + "/validate/check", new NameValueCollection()
{
{"pass", OTPpin},
{"user", OTPuser},
{"realm", realm},
{"transaction_id", transaction_id}
});
client.UploadValues(URL + "/validate/check", request_header);
responseString = Encoding.UTF8.GetString(response);
}
return (getJsonNode(responseString, "status") == "true" && getJsonNode(responseString, "value") == "true");
Expand Down

0 comments on commit b9770a1

Please sign in to comment.