using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
var payload = new {
app_id = "",
app_secret = "",
emp_code = "E1234",
updates = new {
full_name = "New Name",
password = "NewPassword123"
}
};
var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://cportalapi.aksforms.com/api/webhook/update_user", content);
string result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
def sso_login(username, password):
response = requests.post(
"https://cportalapi.aksforms.com/api/sso/verify",
json={
"app_id": "",
"app_secret": "",
"username": username,
"password": password
}
)
if response.status_code == 200:
data = response.json()
return data["token"], data["user"] # Returns JWT and User Info
else:
raise Exception(response.json().get("detail", "Auth Failed"))
using System.Net.Http;
using System.Net.Http.Json;
public async Task<SsoResponse> VerifyWithAuthHub(string username, string password) {
using var client = new HttpClient();
var payload = new {
app_id = "",
app_secret = "",
username = username,
password = password
};
var resp = await client.PostAsJsonAsync("https://cportalapi.aksforms.com/api/sso/verify", payload);
if (resp.IsSuccessStatusCode) {
return await resp.Content.ReadFromJsonAsync<SsoResponse>();
}
throw new Exception("Authentication failed");
}