public static OktaSessionResponse SendBasicLogin(LoginViewModel login) { //create simple class to lowecase & minimize model for json - case sensitive var ologin = new Login { username = login.UserName, password = login.Password }; var sJsonResponse = JsonHelper.Post($"https://{_apiUrlBase}/api/v1/authn", JsonHelper.JsonContent(ologin)); return(JsonConvert.DeserializeObject <OktaSessionResponse>(sJsonResponse)); }
public static TokenIntrospectionResponse IntrospectToken(string token) { var sJsonResponse = JsonHelper.Post($"https://{_apiUrlBase}/oauth2/{_oktaOAuthIssuerId}/v1/introspect?token={token}&token_type_hint=access_token", null, null, _oktaOAuthHeaderAuth); return(JsonConvert.DeserializeObject <TokenIntrospectionResponse>(sJsonResponse)); }
public static OIDCTokenResponse GetToken(string oktaAuthCode) { var sJsonResponse = JsonHelper.Post($"https://{_apiUrlBase}/oauth2/{_oktaOAuthIssuerId}/v1/token?code={oktaAuthCode}&grant_type=authorization_code&redirect_uri={_oktaOAuthRedirectUri}", null, null, _oktaOAuthHeaderAuth); return(JsonConvert.DeserializeObject <OIDCTokenResponse>(sJsonResponse)); }
public static dynamic AddNewCustomer(Customer oCustomer) { var oNewCustomer = new CustomerAdd(oCustomer); return(JsonHelper.Post($"https://{_apiUrlBase}/api/v1/users?activate=true", JsonHelper.JsonContent(oNewCustomer), _oktaToken));; }
public static dynamic UpdateCustomer(Customer oCustomer) { var uc = new CustomerUpdate(oCustomer); var sJsonResponse = JsonHelper.Post($"https://{_apiUrlBase}/api/v1/users/{oCustomer.Id}", JsonHelper.JsonContent(uc), _oktaToken); return(JsonConvert.DeserializeObject(sJsonResponse)); }
public static Customer GetCustomerById(string Id) { var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/users/{Id}", _oktaToken); return(JsonConvert.DeserializeObject <Customer>(sJsonResponse)); }
public static IEnumerable <BaseCustomer> GetAllCustomers() { var sJsonResponse = JsonHelper.Get($"https://{_apiUrlBase}/api/v1/users?limit=100", _oktaToken); return(JsonConvert.DeserializeObject <IEnumerable <BaseCustomer> >(sJsonResponse)); }