private void Accept() { Logger.LogDebug(_packet, "AcceptAccessRequest"); var sGuid = Guid.NewGuid().ToString(); UserSessions[_username] = sGuid; SessionTimestamps[_username] = DateTime.Now; var attributes = new RADIUSAttributes(); var guidAttribute = new RADIUSAttribute(RadiusAttributeType.ReplyMessage, sGuid); attributes.Add(guidAttribute); _packet.AcceptAccessRequest(attributes); }
public void btnSignIn_Click(object sender, EventArgs e) { String username = (string)Session["DomainUserName"]; RADIUSAttributes atts = new RADIUSAttributes(); RADIUSAttribute state = (RADIUSAttribute)Session["state"]; RADIUSClient client = new RADIUSClient(radiusServer, 1812, radiusSecret); atts.Add(state); String encryptedChallangeResult = Crypto.SHA256(username + SmsToken.Text + radiusSecret); RADIUSPacket response = client.Authenticate(username, encryptedChallangeResult, atts); onRadiusResponse(response); }
public void btnSignIn_Click(object sender, EventArgs e) { String username = (string)Session["DomainUserName"]; RADIUSAttributes atts = new RADIUSAttributes(); RADIUSAttribute state = (RADIUSAttribute)Session["state"]; RADIUSClient client = new RADIUSClient(radiusServer, 1812, radiusSecret); atts.Add(state); // Careful to use lower case username in challenge encryption to match what server does. String encryptedChallengeResult = CryptoHelper.SHA256(username.ToLower() + SmsToken.Text + radiusSecret); RADIUSPacket response = client.Authenticate(username, encryptedChallengeResult, atts); onRadiusResponse(response); }