onelogin 1.8.0 → 3.0.0.pre.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +7 -4
- data/README.md +244 -525
- data/Rakefile +7 -3
- data/docs/Action.md +26 -0
- data/docs/ActivateFactorRequest.md +24 -0
- data/docs/AddAccessTokenClaimRequest.md +22 -0
- data/docs/AddClientAppRequest.md +20 -0
- data/docs/AddRoleUsers200ResponseInner.md +18 -0
- data/docs/AddScopeRequest.md +20 -0
- data/docs/AuthMethod.md +15 -0
- data/docs/AuthServerConfiguration.md +24 -0
- data/docs/ClientApp.md +20 -0
- data/docs/Condition.md +22 -0
- data/docs/Connector.md +26 -0
- data/docs/CreateAuthorizationServerRequest.md +22 -0
- data/docs/CreateEnvironmentVariableRequest.md +20 -0
- data/docs/CreateRoles201ResponseInner.md +18 -0
- data/docs/DefaultApi.md +6812 -0
- data/docs/Device.md +26 -0
- data/docs/EnrollFactorRequest.md +28 -0
- data/docs/Envvar.md +24 -0
- data/docs/ErrorStatus.md +22 -0
- data/docs/ErrorStatusErrorsInner.md +20 -0
- data/docs/FactorInner.md +32 -0
- data/docs/FactorInnerFactorData.md +20 -0
- data/docs/GenerateMfaToken200Response.md +24 -0
- data/docs/GenerateMfaToken422Response.md +24 -0
- data/docs/GenerateMfaToken422ResponseDetails.md +18 -0
- data/docs/GenerateMfaTokenRequest.md +20 -0
- data/docs/GenerateSamlAssertionRequest.md +26 -0
- data/docs/GenerateToken200Response.md +28 -0
- data/docs/GenerateToken400Response.md +18 -0
- data/docs/GenerateTokenRequest.md +18 -0
- data/docs/GetAuthorizationServer200Response.md +24 -0
- data/docs/GetAvailableFactors200ResponseInner.md +22 -0
- data/docs/GetClientApps200ResponseInner.md +24 -0
- data/docs/GetClientApps200ResponseInnerScopesInner.md +22 -0
- data/docs/GetRateLimit200Response.md +20 -0
- data/docs/GetRateLimit200ResponseData.md +22 -0
- data/docs/GetRiskScore200Response.md +20 -0
- data/docs/GetRiskScore400Response.md +18 -0
- data/docs/GetRiskScoreRequest.md +30 -0
- data/docs/GetScoreInsights200Response.md +20 -0
- data/docs/GetScoreInsights200ResponseScores.md +26 -0
- data/docs/GetUserApps200ResponseInner.md +32 -0
- data/docs/Hook.md +46 -0
- data/docs/HookConditionsInner.md +22 -0
- data/docs/HookOptions.md +22 -0
- data/docs/HookStatus.md +20 -0
- data/docs/Id.md +18 -0
- data/docs/ListAccessTokenClaims200ResponseInner.md +34 -0
- data/docs/ListActions200ResponseInner.md +20 -0
- data/docs/ListAppUsers200ResponseInner.md +26 -0
- data/docs/ListAuthorizationServers200ResponseInner.md +24 -0
- data/docs/ListAuthorizationServers200ResponseInnerConfiguration.md +20 -0
- data/docs/ListConditionOperators200ResponseInner.md +20 -0
- data/docs/ListConditionValues200ResponseInner.md +20 -0
- data/docs/ListConditions200ResponseInner.md +20 -0
- data/docs/ListMappingConditionOperators200ResponseInner.md +20 -0
- data/docs/ListMappingConditions200ResponseInner.md +20 -0
- data/docs/ListScopes200ResponseInner.md +22 -0
- data/docs/Log.md +24 -0
- data/docs/Mapping.md +30 -0
- data/docs/Registration.md +22 -0
- data/docs/RemoveRoleUsersRequest.md +18 -0
- data/docs/RevokeTokenRequest.md +18 -0
- data/docs/RiskDevice.md +18 -0
- data/docs/RiskRule.md +30 -0
- data/docs/RiskUser.md +22 -0
- data/docs/Role.md +26 -0
- data/docs/Rule.md +30 -0
- data/docs/RuleId.md +18 -0
- data/docs/Schema.md +56 -0
- data/docs/Schema1.md +28 -0
- data/docs/Schema1AddedBy.md +20 -0
- data/docs/SchemaProvisioning.md +18 -0
- data/docs/Session.md +18 -0
- data/docs/SetRoleApps200ResponseInner.md +18 -0
- data/docs/Source.md +20 -0
- data/docs/Status.md +24 -0
- data/docs/Status1.md +22 -0
- data/docs/Status2.md +18 -0
- data/docs/Status2Status.md +24 -0
- data/docs/TrackEventRequest.md +34 -0
- data/docs/UpdateAuthorizationServer400Response.md +24 -0
- data/docs/UpdateClientAppRequest.md +18 -0
- data/docs/UpdateEnvironmentVariableRequest.md +18 -0
- data/docs/UpdateRole200Response.md +18 -0
- data/docs/User.md +90 -0
- data/docs/VerifyEnrollmentRequest.md +18 -0
- data/docs/VerifyFactorRequest.md +20 -0
- data/docs/VerifyFactorSaml200Response.md +20 -0
- data/docs/VerifyFactorSamlRequest.md +26 -0
- data/docs/VerifyFactorVoice200ResponseInner.md +22 -0
- data/git_push.sh +57 -0
- data/lib/onelogin/api/default_api.rb +7334 -0
- data/lib/onelogin/api_client.rb +391 -0
- data/lib/onelogin/api_error.rb +57 -0
- data/lib/onelogin/configuration.rb +282 -0
- data/lib/onelogin/models/action.rb +262 -0
- data/lib/onelogin/models/activate_factor_request.rb +250 -0
- data/lib/onelogin/models/add_access_token_claim_request.rb +237 -0
- data/lib/onelogin/models/add_client_app_request.rb +230 -0
- data/lib/onelogin/models/add_role_users200_response_inner.rb +219 -0
- data/lib/onelogin/models/add_scope_request.rb +228 -0
- data/lib/onelogin/models/auth_method.rb +43 -0
- data/lib/onelogin/models/auth_server_configuration.rb +248 -0
- data/lib/onelogin/models/client_app.rb +228 -0
- data/lib/onelogin/models/condition.rb +240 -0
- data/lib/onelogin/models/connector.rb +259 -0
- data/lib/onelogin/models/create_authorization_server_request.rb +237 -0
- data/lib/onelogin/models/create_environment_variable_request.rb +240 -0
- data/lib/onelogin/models/create_roles201_response_inner.rb +219 -0
- data/lib/onelogin/models/device.rb +255 -0
- data/lib/onelogin/models/enroll_factor_request.rb +280 -0
- data/lib/onelogin/models/envvar.rb +250 -0
- data/lib/onelogin/models/error_status.rb +239 -0
- data/lib/onelogin/models/error_status_errors_inner.rb +230 -0
- data/lib/onelogin/models/factor_inner.rb +323 -0
- data/lib/onelogin/models/factor_inner_factor_data.rb +231 -0
- data/lib/onelogin/models/generate_mfa_token200_response.rb +250 -0
- data/lib/onelogin/models/generate_mfa_token422_response.rb +246 -0
- data/lib/onelogin/models/generate_mfa_token422_response_details.rb +221 -0
- data/lib/onelogin/models/generate_mfa_token_request.rb +230 -0
- data/lib/onelogin/models/generate_saml_assertion_request.rb +280 -0
- data/lib/onelogin/models/generate_token200_response.rb +264 -0
- data/lib/onelogin/models/generate_token400_response.rb +219 -0
- data/lib/onelogin/models/generate_token_request.rb +253 -0
- data/lib/onelogin/models/get_authorization_server200_response.rb +246 -0
- data/lib/onelogin/models/get_available_factors200_response_inner.rb +240 -0
- data/lib/onelogin/models/get_client_apps200_response_inner.rb +248 -0
- data/lib/onelogin/models/get_client_apps200_response_inner_scopes_inner.rb +237 -0
- data/lib/onelogin/models/get_rate_limit200_response.rb +228 -0
- data/lib/onelogin/models/get_rate_limit200_response_data.rb +237 -0
- data/lib/onelogin/models/get_risk_score200_response.rb +256 -0
- data/lib/onelogin/models/get_risk_score400_response.rb +221 -0
- data/lib/onelogin/models/get_risk_score_request.rb +291 -0
- data/lib/onelogin/models/get_score_insights200_response.rb +228 -0
- data/lib/onelogin/models/get_score_insights200_response_scores.rb +255 -0
- data/lib/onelogin/models/get_user_apps200_response_inner.rb +335 -0
- data/lib/onelogin/models/hook.rb +462 -0
- data/lib/onelogin/models/hook_conditions_inner.rb +237 -0
- data/lib/onelogin/models/hook_options.rb +238 -0
- data/lib/onelogin/models/hook_status.rb +228 -0
- data/lib/onelogin/models/id.rb +219 -0
- data/lib/onelogin/models/list_access_token_claims200_response_inner.rb +293 -0
- data/lib/onelogin/models/list_actions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_app_users200_response_inner.rb +255 -0
- data/lib/onelogin/models/list_authorization_servers200_response_inner.rb +246 -0
- data/lib/onelogin/models/list_authorization_servers200_response_inner_configuration.rb +230 -0
- data/lib/onelogin/models/list_condition_operators200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_condition_values200_response_inner.rb +228 -0
- data/lib/onelogin/models/list_conditions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_mapping_condition_operators200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_mapping_conditions200_response_inner.rb +230 -0
- data/lib/onelogin/models/list_scopes200_response_inner.rb +237 -0
- data/lib/onelogin/models/log.rb +248 -0
- data/lib/onelogin/models/mapping.rb +342 -0
- data/lib/onelogin/models/registration.rb +274 -0
- data/lib/onelogin/models/remove_role_users_request.rb +221 -0
- data/lib/onelogin/models/revoke_token_request.rb +219 -0
- data/lib/onelogin/models/risk_device.rb +221 -0
- data/lib/onelogin/models/risk_rule.rb +325 -0
- data/lib/onelogin/models/risk_user.rb +248 -0
- data/lib/onelogin/models/role.rb +266 -0
- data/lib/onelogin/models/rule.rb +317 -0
- data/lib/onelogin/models/rule_id.rb +219 -0
- data/lib/onelogin/models/schema.rb +441 -0
- data/lib/onelogin/models/schema1.rb +265 -0
- data/lib/onelogin/models/schema1_added_by.rb +228 -0
- data/lib/onelogin/models/schema_provisioning.rb +220 -0
- data/lib/onelogin/models/session.rb +221 -0
- data/lib/onelogin/models/set_role_apps200_response_inner.rb +220 -0
- data/lib/onelogin/models/source.rb +230 -0
- data/lib/onelogin/models/status.rb +246 -0
- data/lib/onelogin/models/status1.rb +237 -0
- data/lib/onelogin/models/status2.rb +219 -0
- data/lib/onelogin/models/status2_status.rb +246 -0
- data/lib/onelogin/models/track_event_request.rb +316 -0
- data/lib/onelogin/models/update_authorization_server400_response.rb +246 -0
- data/lib/onelogin/models/update_client_app_request.rb +221 -0
- data/lib/onelogin/models/update_environment_variable_request.rb +225 -0
- data/lib/onelogin/models/update_role200_response.rb +219 -0
- data/lib/onelogin/models/user.rb +615 -0
- data/lib/onelogin/models/verify_enrollment_request.rb +219 -0
- data/lib/onelogin/models/verify_factor_request.rb +230 -0
- data/lib/onelogin/models/verify_factor_saml200_response.rb +230 -0
- data/lib/onelogin/models/verify_factor_saml_request.rb +275 -0
- data/lib/onelogin/models/verify_factor_voice200_response_inner.rb +271 -0
- data/lib/onelogin/version.rb +13 -1
- data/lib/onelogin.rb +130 -1
- data/onelogin.gemspec +35 -43
- data/spec/api/default_api_spec.rb +1259 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +58 -0
- data/spec/models/activate_factor_request_spec.rb +52 -0
- data/spec/models/add_access_token_claim_request_spec.rb +46 -0
- data/spec/models/add_client_app_request_spec.rb +40 -0
- data/spec/models/add_role_users200_response_inner_spec.rb +34 -0
- data/spec/models/add_scope_request_spec.rb +40 -0
- data/spec/models/auth_method_spec.rb +28 -0
- data/spec/models/auth_server_configuration_spec.rb +52 -0
- data/spec/models/client_app_spec.rb +40 -0
- data/spec/models/condition_spec.rb +46 -0
- data/spec/models/connector_spec.rb +58 -0
- data/spec/models/create_authorization_server_request_spec.rb +46 -0
- data/spec/models/create_environment_variable_request_spec.rb +40 -0
- data/spec/models/create_roles201_response_inner_spec.rb +34 -0
- data/spec/models/device_spec.rb +58 -0
- data/spec/models/enroll_factor_request_spec.rb +64 -0
- data/spec/models/envvar_spec.rb +52 -0
- data/spec/models/error_status_errors_inner_spec.rb +40 -0
- data/spec/models/error_status_spec.rb +46 -0
- data/spec/models/factor_inner_factor_data_spec.rb +40 -0
- data/spec/models/factor_inner_spec.rb +80 -0
- data/spec/models/generate_mfa_token200_response_spec.rb +52 -0
- data/spec/models/generate_mfa_token422_response_details_spec.rb +34 -0
- data/spec/models/generate_mfa_token422_response_spec.rb +52 -0
- data/spec/models/generate_mfa_token_request_spec.rb +40 -0
- data/spec/models/generate_saml_assertion_request_spec.rb +58 -0
- data/spec/models/generate_token200_response_spec.rb +64 -0
- data/spec/models/generate_token400_response_spec.rb +34 -0
- data/spec/models/generate_token_request_spec.rb +38 -0
- data/spec/models/get_authorization_server200_response_spec.rb +52 -0
- data/spec/models/get_available_factors200_response_inner_spec.rb +46 -0
- data/spec/models/get_client_apps200_response_inner_scopes_inner_spec.rb +46 -0
- data/spec/models/get_client_apps200_response_inner_spec.rb +52 -0
- data/spec/models/get_rate_limit200_response_data_spec.rb +46 -0
- data/spec/models/get_rate_limit200_response_spec.rb +40 -0
- data/spec/models/get_risk_score200_response_spec.rb +40 -0
- data/spec/models/get_risk_score400_response_spec.rb +34 -0
- data/spec/models/get_risk_score_request_spec.rb +70 -0
- data/spec/models/get_score_insights200_response_scores_spec.rb +58 -0
- data/spec/models/get_score_insights200_response_spec.rb +40 -0
- data/spec/models/get_user_apps200_response_inner_spec.rb +84 -0
- data/spec/models/hook_conditions_inner_spec.rb +46 -0
- data/spec/models/hook_options_spec.rb +46 -0
- data/spec/models/hook_spec.rb +122 -0
- data/spec/models/hook_status_spec.rb +40 -0
- data/spec/models/id_spec.rb +34 -0
- data/spec/models/list_access_token_claims200_response_inner_spec.rb +82 -0
- data/spec/models/list_actions200_response_inner_spec.rb +40 -0
- data/spec/models/list_app_users200_response_inner_spec.rb +58 -0
- data/spec/models/list_authorization_servers200_response_inner_configuration_spec.rb +40 -0
- data/spec/models/list_authorization_servers200_response_inner_spec.rb +52 -0
- data/spec/models/list_condition_operators200_response_inner_spec.rb +40 -0
- data/spec/models/list_condition_values200_response_inner_spec.rb +40 -0
- data/spec/models/list_conditions200_response_inner_spec.rb +40 -0
- data/spec/models/list_mapping_condition_operators200_response_inner_spec.rb +40 -0
- data/spec/models/list_mapping_conditions200_response_inner_spec.rb +40 -0
- data/spec/models/list_scopes200_response_inner_spec.rb +46 -0
- data/spec/models/log_spec.rb +52 -0
- data/spec/models/mapping_spec.rb +74 -0
- data/spec/models/registration_spec.rb +50 -0
- data/spec/models/remove_role_users_request_spec.rb +34 -0
- data/spec/models/revoke_token_request_spec.rb +34 -0
- data/spec/models/risk_device_spec.rb +34 -0
- data/spec/models/risk_rule_spec.rb +78 -0
- data/spec/models/risk_user_spec.rb +46 -0
- data/spec/models/role_spec.rb +58 -0
- data/spec/models/rule_id_spec.rb +34 -0
- data/spec/models/rule_spec.rb +74 -0
- data/spec/models/schema1_added_by_spec.rb +40 -0
- data/spec/models/schema1_spec.rb +64 -0
- data/spec/models/schema_provisioning_spec.rb +34 -0
- data/spec/models/schema_spec.rb +152 -0
- data/spec/models/session_spec.rb +34 -0
- data/spec/models/set_role_apps200_response_inner_spec.rb +34 -0
- data/spec/models/source_spec.rb +40 -0
- data/spec/models/status1_spec.rb +46 -0
- data/spec/models/status2_spec.rb +34 -0
- data/spec/models/status2_status_spec.rb +52 -0
- data/spec/models/status_spec.rb +52 -0
- data/spec/models/track_event_request_spec.rb +82 -0
- data/spec/models/update_authorization_server400_response_spec.rb +52 -0
- data/spec/models/update_client_app_request_spec.rb +34 -0
- data/spec/models/update_environment_variable_request_spec.rb +34 -0
- data/spec/models/update_role200_response_spec.rb +34 -0
- data/spec/models/user_spec.rb +258 -0
- data/spec/models/verify_enrollment_request_spec.rb +34 -0
- data/spec/models/verify_factor_request_spec.rb +40 -0
- data/spec/models/verify_factor_saml200_response_spec.rb +40 -0
- data/spec/models/verify_factor_saml_request_spec.rb +58 -0
- data/spec/models/verify_factor_voice200_response_inner_spec.rb +50 -0
- data/spec/spec_helper.rb +111 -0
- metadata +404 -127
- data/.github/workflows/git-secrets-public.yml +0 -55
- data/.github/workflows/test.yml +0 -25
- data/.gitignore +0 -13
- data/bin/console +0 -14
- data/bin/setup +0 -6
- data/examples/Gemfile +0 -3
- data/examples/Gemfile.lock +0 -29
- data/examples/README.md +0 -19
- data/examples/all-users-to-csv.rb +0 -48
- data/examples/another-get-all-login-events-of-last-day-to-csv.rb +0 -141
- data/examples/create-user.rb +0 -16
- data/examples/events-to-csv.rb +0 -94
- data/examples/get-all-login-events-of-last-day-to-csv.rb +0 -88
- data/examples/last-app-user-login-to-csv.rb +0 -72
- data/examples/list-users.rb +0 -15
- data/lib/onelogin/api/apiexception.rb +0 -13
- data/lib/onelogin/api/client.rb +0 -3019
- data/lib/onelogin/api/cursor.rb +0 -117
- data/lib/onelogin/api/models/app.rb +0 -22
- data/lib/onelogin/api/models/auth_factor.rb +0 -16
- data/lib/onelogin/api/models/connector_basic.rb +0 -20
- data/lib/onelogin/api/models/device.rb +0 -18
- data/lib/onelogin/api/models/embed_app.rb +0 -31
- data/lib/onelogin/api/models/event.rb +0 -54
- data/lib/onelogin/api/models/event_type.rb +0 -17
- data/lib/onelogin/api/models/factor_enrollment_response.rb +0 -22
- data/lib/onelogin/api/models/group.rb +0 -17
- data/lib/onelogin/api/models/mfa.rb +0 -26
- data/lib/onelogin/api/models/mfa_token.rb +0 -18
- data/lib/onelogin/api/models/onelogin_app.rb +0 -62
- data/lib/onelogin/api/models/onelogin_app_basic.rb +0 -51
- data/lib/onelogin/api/models/onelogin_app_v1.rb +0 -22
- data/lib/onelogin/api/models/onelogin_token.rb +0 -20
- data/lib/onelogin/api/models/otp_device.rb +0 -25
- data/lib/onelogin/api/models/privilege.rb +0 -51
- data/lib/onelogin/api/models/rate_limit.rb +0 -17
- data/lib/onelogin/api/models/role.rb +0 -16
- data/lib/onelogin/api/models/saml_endpoint_response.rb +0 -18
- data/lib/onelogin/api/models/session_token_info.rb +0 -21
- data/lib/onelogin/api/models/session_token_mfa_info.rb +0 -26
- data/lib/onelogin/api/models/statement.rb +0 -36
- data/lib/onelogin/api/models/user.rb +0 -135
- data/lib/onelogin/api/models/user_data.rb +0 -13
- data/lib/onelogin/api/models/user_metadata.rb +0 -13
- data/lib/onelogin/api/models.rb +0 -26
- data/lib/onelogin/api/util/constants.rb +0 -177
- data/lib/onelogin/api/util/parser.rb +0 -56
- data/lib/onelogin/api/util/url_builder.rb +0 -24
- data/lib/onelogin/api/util.rb +0 -13
- data/lib/onelogin/api.rb +0 -2
data/.gitignore
DELETED
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "onelogin"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/examples/Gemfile
DELETED
data/examples/Gemfile.lock
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
GEM
|
|
2
|
-
remote: https://rubygems.org/
|
|
3
|
-
specs:
|
|
4
|
-
bigdecimal (4.1.2)
|
|
5
|
-
csv (3.3.6)
|
|
6
|
-
httparty (0.24.2)
|
|
7
|
-
csv
|
|
8
|
-
mini_mime (>= 1.0.0)
|
|
9
|
-
multi_xml (>= 0.5.2)
|
|
10
|
-
mini_mime (1.1.5)
|
|
11
|
-
mini_portile2 (2.8.9)
|
|
12
|
-
multi_xml (0.9.1)
|
|
13
|
-
bigdecimal (>= 3.1, < 5)
|
|
14
|
-
nokogiri (1.19.4)
|
|
15
|
-
mini_portile2 (~> 2.8.2)
|
|
16
|
-
racc (~> 1.4)
|
|
17
|
-
onelogin (1.7.0)
|
|
18
|
-
httparty (>= 0.13.7)
|
|
19
|
-
nokogiri (>= 1.6.3.1)
|
|
20
|
-
racc (1.8.1)
|
|
21
|
-
|
|
22
|
-
PLATFORMS
|
|
23
|
-
ruby
|
|
24
|
-
|
|
25
|
-
DEPENDENCIES
|
|
26
|
-
onelogin
|
|
27
|
-
|
|
28
|
-
BUNDLED WITH
|
|
29
|
-
2.6.9
|
data/examples/README.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Ruby SDK Examples
|
|
2
|
-
|
|
3
|
-
This folder contains various samples that make use of the OneLogin
|
|
4
|
-
Ruby SDK.
|
|
5
|
-
|
|
6
|
-
It assumes that you have a valid OneLogin `client_id` and `client_secret`
|
|
7
|
-
with the appropriate level of access for each example.
|
|
8
|
-
|
|
9
|
-
## Try the examples in terminal
|
|
10
|
-
|
|
11
|
-
First install the OneLogin gem and any other required gems
|
|
12
|
-
```shell
|
|
13
|
-
bundle install
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Then update your API credentials in the example file and run it
|
|
17
|
-
```shell
|
|
18
|
-
ruby create-user.rb
|
|
19
|
-
```
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
require 'onelogin'
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
# This example shows how you can export user details from OneLogin using the Ruby SDK
|
|
5
|
-
#
|
|
6
|
-
# Usage:
|
|
7
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
|
8
|
-
# 2. From terminal run "ruby all-users-to-csv.rb" to extract all users including
|
|
9
|
-
# any custom attributes that might have been defined for the each user
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
client = OneLogin::Api::Client.new(
|
|
13
|
-
client_id: 'ONELOGIN_CLIENT_ID',
|
|
14
|
-
client_secret:'ONELOGIN_CLIENT_SECRET',
|
|
15
|
-
region: 'us',
|
|
16
|
-
max_results: 50000
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
attribute_names = ['id', 'external_id', 'email', 'username', 'firstname', 'lastname', 'distinguished_name',
|
|
20
|
-
'phone', 'company', 'department', 'status', 'member_of', 'samaccountname', 'userprincipalname',
|
|
21
|
-
'group_id', 'role_ids', 'custom_attributes', 'openid_name', 'locale_code', 'comment', 'directory_id',
|
|
22
|
-
'manager_ad_id', 'trusted_idp_id', 'activated_at', 'created_at', 'updated_at',
|
|
23
|
-
'password_changed_at', 'invitation_sent_at', 'invalid_login_attempts', 'last_login', 'locked_until']
|
|
24
|
-
|
|
25
|
-
custom_attribute_names = client.get_custom_attributes
|
|
26
|
-
|
|
27
|
-
CSV.open('users.csv', 'wb') do |csv|
|
|
28
|
-
# header row
|
|
29
|
-
csv << attribute_names + custom_attribute_names
|
|
30
|
-
|
|
31
|
-
client.get_users.each do |user|
|
|
32
|
-
|
|
33
|
-
row = []
|
|
34
|
-
|
|
35
|
-
# standard attributes
|
|
36
|
-
attribute_names.each do |attribute_name|
|
|
37
|
-
row << user.send(attribute_name)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# custom attributes
|
|
41
|
-
custom_attribute_names.each do |attribute_name|
|
|
42
|
-
row << user.custom_attributes[attribute_name] unless user.custom_attributes.empty?
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
csv << row
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
require 'onelogin'
|
|
2
|
-
|
|
3
|
-
client = OneLogin::Api::Client.new(
|
|
4
|
-
client_id: '9a19e9b07257c30ed3eddc0f9cf8d4127b4387646940acc8432c0dbcbd5f0c0d',
|
|
5
|
-
client_secret: 'd5cfcbe70b626f1d131f632c398b5b0d60dbc149b9ad9a55ac33715c7239acf7',
|
|
6
|
-
region: 'us',
|
|
7
|
-
max_results: 50000
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
client.access_token
|
|
11
|
-
|
|
12
|
-
unless client.error.nil?
|
|
13
|
-
puts "Error #{client.error} #{client.error_description}"
|
|
14
|
-
exit
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
user_attribute_names = ['id', 'username', 'email']
|
|
19
|
-
event_attribute_names = ['created_at', 'user_id', 'user_name', 'ipaddr', 'app_id', 'app_name']
|
|
20
|
-
csv_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'Email', 'App Id']
|
|
21
|
-
|
|
22
|
-
user_options = {}
|
|
23
|
-
user_options[:fields] = user_attribute_names.join(",")
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
now = Date.today
|
|
27
|
-
days_ago = (now - 1)
|
|
28
|
-
event_options = {}
|
|
29
|
-
event_options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
30
|
-
event_options[:event_type_id] = 8;
|
|
31
|
-
event_options[:fields] = event_attribute_names.join(",")
|
|
32
|
-
event_options[:sort] = "-created_at"
|
|
33
|
-
|
|
34
|
-
now_str = Time.now.strftime("%Y-%m-%d_%H-%M-%S")
|
|
35
|
-
login_app_event_csv_name = now_str + '_login_app_events.csv'
|
|
36
|
-
login_event_csv_name = now_str + '_login_events.csv'
|
|
37
|
-
radius_event_csv_name = now_str + '_radius_events.csv'
|
|
38
|
-
|
|
39
|
-
users = {}
|
|
40
|
-
counter = 0
|
|
41
|
-
|
|
42
|
-
rate_limits = client.get_rate_limits
|
|
43
|
-
remaining_before = rate_limits.remaining
|
|
44
|
-
puts "Remaining RateLimit: #{remaining_before}"
|
|
45
|
-
|
|
46
|
-
puts "Extracting users from OneLogin"
|
|
47
|
-
|
|
48
|
-
client.get_users(user_options).each do |user|
|
|
49
|
-
users[user.id] = user
|
|
50
|
-
counter +=1
|
|
51
|
-
end
|
|
52
|
-
puts "#{counter} users extracted"
|
|
53
|
-
|
|
54
|
-
csv_login_app_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'App Id', 'Email']
|
|
55
|
-
csv_login_event_header = ['Timestamp', 'Description', 'Username', 'IP Address', 'User Id', 'Email']
|
|
56
|
-
|
|
57
|
-
puts "Extracting login app events from OneLogin"
|
|
58
|
-
counter = 0
|
|
59
|
-
CSV.open(login_app_event_csv_name, 'wb') do |csv|
|
|
60
|
-
# header row
|
|
61
|
-
csv << csv_login_app_event_header
|
|
62
|
-
|
|
63
|
-
# fetch the events
|
|
64
|
-
client.get_events(event_options).each do |event|
|
|
65
|
-
username = email = ""
|
|
66
|
-
description = "#{event.user_name} signed into #{event.app_name}"
|
|
67
|
-
unless users.nil?
|
|
68
|
-
if users.has_key?(event.user_id)
|
|
69
|
-
username = users[event.user_id].username
|
|
70
|
-
email = users[event.user_id].email
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
csv << [event.created_at, description, username, event.app_name, event.ipaddr, event.user_id, event.app_id, email]
|
|
74
|
-
counter +=1
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
puts "Exported #{counter} login app events to #{login_app_event_csv_name}"
|
|
78
|
-
|
|
79
|
-
rate_limits = client.get_rate_limits
|
|
80
|
-
remaining_after = rate_limits.remaining
|
|
81
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
event_options[:event_type_id] = 5;
|
|
85
|
-
puts "Extracting login events from OneLogin"
|
|
86
|
-
counter = 0
|
|
87
|
-
CSV.open(login_event_csv_name, 'wb') do |csv|
|
|
88
|
-
# header row
|
|
89
|
-
csv << csv_login_event_header
|
|
90
|
-
|
|
91
|
-
# fetch the events
|
|
92
|
-
client.get_events(event_options).each do |event|
|
|
93
|
-
username = email = ""
|
|
94
|
-
description = "#{event.user_name} logged into OneLogin"
|
|
95
|
-
unless users.nil?
|
|
96
|
-
if users.has_key?(event.user_id)
|
|
97
|
-
username = users[event.user_id].username
|
|
98
|
-
email = users[event.user_id].email
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
csv << [event.created_at, description, username, event.ipaddr, event.user_id, email]
|
|
102
|
-
counter +=1
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
puts "Exported #{counter} login events to #{login_event_csv_name}"
|
|
106
|
-
|
|
107
|
-
rate_limits = client.get_rate_limits
|
|
108
|
-
remaining_after = rate_limits.remaining
|
|
109
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
event_options[:event_type_id] = 68;
|
|
113
|
-
puts "Extracting login radius events from OneLogin"
|
|
114
|
-
counter = 0
|
|
115
|
-
CSV.open(radius_event_csv_name, 'wb') do |csv|
|
|
116
|
-
# header row
|
|
117
|
-
csv << csv_login_event_header
|
|
118
|
-
|
|
119
|
-
# fetch the events
|
|
120
|
-
client.get_events(event_options).each do |event|
|
|
121
|
-
username = email = ""
|
|
122
|
-
description = "#{event.user_name} logged via Radius"
|
|
123
|
-
unless users.nil?
|
|
124
|
-
if users.has_key?(event.user_id)
|
|
125
|
-
username = users[event.user_id].username
|
|
126
|
-
email = users[event.user_id].email
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
csv << [event.created_at, description, username, event.ipaddr, event.user_id, email]
|
|
130
|
-
counter +=1
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
puts "Exported #{counter} radius events to #{radius_event_csv_name}"
|
|
134
|
-
|
|
135
|
-
rate_limits = client.get_rate_limits
|
|
136
|
-
remaining_after = rate_limits.remaining
|
|
137
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
consumed = remaining_before - remaining_after
|
|
141
|
-
puts "The script consumed #{consumed} calls"
|
data/examples/create-user.rb
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require 'onelogin'
|
|
2
|
-
|
|
3
|
-
client = OneLogin::Api::Client.new(
|
|
4
|
-
client_id: 'ONELOGIN_CLIENT_ID',
|
|
5
|
-
client_secret:'ONELOGIN_CLIENT_SECRET',
|
|
6
|
-
region: 'us'
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
user = client.create_user(
|
|
10
|
-
firstname: "Mick",
|
|
11
|
-
lastname: "Fanning",
|
|
12
|
-
email: "mick@onelogin.com",
|
|
13
|
-
username: "mick"
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
puts user
|
data/examples/events-to-csv.rb
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
require 'onelogin'
|
|
2
|
-
require 'optparse'
|
|
3
|
-
require 'optparse/time'
|
|
4
|
-
|
|
5
|
-
#
|
|
6
|
-
# This example shows how you can export events from OneLogin using the Ruby SDK
|
|
7
|
-
#
|
|
8
|
-
# Usage:
|
|
9
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
|
10
|
-
# 2. From terminal run "ruby events-to-csv.rb" for the last 1000 events
|
|
11
|
-
# 3. Use the command line args to filter events
|
|
12
|
-
#
|
|
13
|
-
# e.g. "ruby events-to-csv.rb -t 5 -s 2018-01-01" for login events since Jan 1 2018
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# Parse CLI arguments
|
|
18
|
-
options = {}
|
|
19
|
-
|
|
20
|
-
OptionParser.new do |opts|
|
|
21
|
-
opts.banner = "Usage: events-to-csv.rb [options]"
|
|
22
|
-
|
|
23
|
-
opts.on("-sSINCE", "--since=SINCE", Time, "Events after this date") do |s|
|
|
24
|
-
options[:since] = s.iso8601
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
opts.on("-dLAST", "--last=LAST", Integer, "Events since this many days ago") do |d|
|
|
28
|
-
now = Date.today
|
|
29
|
-
days_ago = (now - d)
|
|
30
|
-
options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
opts.on("-bUNTIL", "--until=UNTIL", Time, "Events before this date") do |u|
|
|
34
|
-
options[:until] = u.iso8601
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
opts.on("-lLIMIT", "--limit=LIMIT", Integer, "Only return this many events, Default 1000") do |l|
|
|
38
|
-
options[:limit] = l
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
opts.on("-tTYPE", "--type=TYPE", Integer, "Filter by event type id") do |t|
|
|
42
|
-
options[:event_type_id] = t
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
opts.on("-uUSER", "--user=USER", Integer, "Filter by user id") do |u|
|
|
46
|
-
options[:user_id] = u
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# Sort direction is done by adding a + or - before the field name that you want to sort on
|
|
50
|
-
opts.on("-zSORT", "--sort=SORT", String, "Sort by this field") do |s|
|
|
51
|
-
options[:sort] = s
|
|
52
|
-
end
|
|
53
|
-
end.parse!
|
|
54
|
-
|
|
55
|
-
counter = 0
|
|
56
|
-
limit = options[:limit] || 1000
|
|
57
|
-
|
|
58
|
-
# Fetch the events
|
|
59
|
-
client = OneLogin::Api::Client.new(
|
|
60
|
-
client_id: 'ONELOGIN_CLIENT_ID_GOES_HERE',
|
|
61
|
-
client_secret: 'ONELOGIN_CLIENT_SECRET_GOES_HERE',
|
|
62
|
-
region: 'us',
|
|
63
|
-
max_results: limit
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
attribute_names = ['id', 'created_at', 'account_id', 'user_id', 'user_name', 'event_type_id',
|
|
67
|
-
'notes', 'ipaddr', 'actor_user_id', 'actor_user_name', 'assuming_acting_user_id',
|
|
68
|
-
'role_id', 'role_name', 'app_id', 'app_name', 'group_id', 'group_name', 'otp_device_id',
|
|
69
|
-
'otp_device_name', 'policy_id', 'policy_name', 'actor_system', 'custom_message',
|
|
70
|
-
'operation_name', 'directory_sync_run_id', 'directory_id', 'resolution', 'client_id',
|
|
71
|
-
'resource_type_id', 'error_description', 'risk_score', 'risk_reasons', 'risk_cookie_id', 'browser_fingerprint']
|
|
72
|
-
|
|
73
|
-
# We remove limit from options parsed to the api as we want to fetch
|
|
74
|
-
# the max number of records possible and then use the cursor that is
|
|
75
|
-
# built into the ruby sdk to limit the results
|
|
76
|
-
options.delete(:limit)
|
|
77
|
-
|
|
78
|
-
CSV.open('events.csv', 'wb') do |csv|
|
|
79
|
-
puts "Exporting events to events.csv"
|
|
80
|
-
|
|
81
|
-
# header row
|
|
82
|
-
csv << attribute_names
|
|
83
|
-
|
|
84
|
-
# fetch the events
|
|
85
|
-
client.get_events(options).take(limit).each do |event|
|
|
86
|
-
csv << attribute_names.map { |attribute_name| event.send(attribute_name) if event.respond_to?(attribute_name) }
|
|
87
|
-
counter += 1
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
puts "Exported #{counter} events to events.csv"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
require 'onelogin'
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
# This example shows how you can export user details from OneLogin using the Ruby SDK
|
|
5
|
-
#
|
|
6
|
-
# Usage:
|
|
7
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
|
8
|
-
# 2. From terminal run "ruby all-users-to-csv.rb" to extract all users including
|
|
9
|
-
# any custom attributes that might have been defined for the each user
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
#client = OneLogin::Api::Client.new(
|
|
13
|
-
# client_id: 'ONELOGIN_CLIENT_ID',
|
|
14
|
-
# client_secret:'ONELOGIN_CLIENT_SECRET',
|
|
15
|
-
# region: 'us',
|
|
16
|
-
# max_results: 50000
|
|
17
|
-
#)
|
|
18
|
-
client = OneLogin::Api::Client.new(
|
|
19
|
-
client_id: 'ONELOGIN_CLIENT_ID_GOES_HERE',
|
|
20
|
-
client_secret: 'ONELOGIN_CLIENT_SECRET_GOES_HERE',
|
|
21
|
-
region: 'us',
|
|
22
|
-
max_results: 50000
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
user_attribute_names = ['id', 'username', 'email']
|
|
27
|
-
event_attribute_names = ['created_at', 'user_id', 'user_name', 'ipaddr', 'app_id', 'app_name']
|
|
28
|
-
csv_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'Email', 'App Id']
|
|
29
|
-
|
|
30
|
-
user_options = {}
|
|
31
|
-
user_options[:fields] = user_attribute_names.join(",")
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
now = Date.today
|
|
35
|
-
days_ago = (now - 1)
|
|
36
|
-
event_options = {}
|
|
37
|
-
event_options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
38
|
-
event_options[:event_type_id] = 8;
|
|
39
|
-
event_options[:fields] = event_attribute_names.join(",")
|
|
40
|
-
event_options[:sort] = "-created_at"
|
|
41
|
-
|
|
42
|
-
now_str = Time.now.strftime("%Y-%m-%d_%H-%M-%S")
|
|
43
|
-
event_csv_name = now_str + '_events.csv'
|
|
44
|
-
|
|
45
|
-
users = {}
|
|
46
|
-
counter = 0
|
|
47
|
-
|
|
48
|
-
rate_limits = client.get_rate_limits
|
|
49
|
-
remaining_before = rate_limits.remaining
|
|
50
|
-
puts "Remaining RateLimit: #{remaining_before}"
|
|
51
|
-
|
|
52
|
-
puts "Extracting users from OneLogin"
|
|
53
|
-
|
|
54
|
-
client.get_users(user_options).each do |user|
|
|
55
|
-
users[user.id] = user
|
|
56
|
-
counter +=1
|
|
57
|
-
end
|
|
58
|
-
puts "#{counter} users extracted"
|
|
59
|
-
|
|
60
|
-
puts "Extracting events from OneLogin"
|
|
61
|
-
csv_event_header = ['Timestamp', 'Description', 'Username', 'App', 'IP Address', 'User Id', 'App Id', 'Email']
|
|
62
|
-
counter = 0
|
|
63
|
-
CSV.open(event_csv_name, 'wb') do |csv|
|
|
64
|
-
# header row
|
|
65
|
-
csv << csv_event_header
|
|
66
|
-
|
|
67
|
-
# fetch the events
|
|
68
|
-
client.get_events(event_options).each do |event|
|
|
69
|
-
username = email = ""
|
|
70
|
-
description = "#{event.user_name} signed into #{event.app_name}"
|
|
71
|
-
unless users.nil?
|
|
72
|
-
if users.has_key?(event.user_id)
|
|
73
|
-
username = users[event.user_id].username
|
|
74
|
-
email = users[event.user_id].email
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
csv << [event.created_at, description, username, event.app_name, event.ipaddr, event.user_id, event.app_id, email]
|
|
78
|
-
counter +=1
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
puts "Exported #{counter} events to events.csv"
|
|
82
|
-
|
|
83
|
-
rate_limits = client.get_rate_limits
|
|
84
|
-
remaining_after = rate_limits.remaining
|
|
85
|
-
puts "Remaining RateLimit: #{remaining_after}"
|
|
86
|
-
|
|
87
|
-
consumed = remaining_before - remaining_after
|
|
88
|
-
puts "The script consumed #{consumed} calls"
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
require 'onelogin'
|
|
2
|
-
require 'optparse'
|
|
3
|
-
require 'optparse/time'
|
|
4
|
-
|
|
5
|
-
#
|
|
6
|
-
# This generates a report listing the last login date for all users who have logged into a specified app in the last x days.
|
|
7
|
-
#
|
|
8
|
-
# Usage:
|
|
9
|
-
# 1. Set your own CLIENT_ID and CLIENT_SECRET below
|
|
10
|
-
# 2. From terminal run "ruby last-app-user-login-to-csv.rb"
|
|
11
|
-
# 3. Use the command line args to filter events
|
|
12
|
-
#
|
|
13
|
-
# e.g. "ruby last-app-user-login-to-csv.rb -l 90" for last 90 days
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# Parse CLI arguments
|
|
18
|
-
options = {
|
|
19
|
-
event_type_id: 8, # User Logged into an App
|
|
20
|
-
sort: '-created_at'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
OptionParser.new do |opts|
|
|
24
|
-
opts.banner = "Usage: last-app-user-login-to-csv.rb [options]"
|
|
25
|
-
|
|
26
|
-
opts.on("-lLAST", "--LAST=LAST", Integer, "Events since this many days ago") do |d|
|
|
27
|
-
now = Date.today
|
|
28
|
-
days_ago = (now - d)
|
|
29
|
-
options[:since] = days_ago.strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
end.parse!
|
|
33
|
-
|
|
34
|
-
client = OneLogin::Api::Client.new(
|
|
35
|
-
client_id: 'ONELOGIN_CLIENT_ID_GOES_HERE',
|
|
36
|
-
client_secret: 'ONELOGIN_CLIENT_SECRET_GOES_HERE',
|
|
37
|
-
region: 'us',
|
|
38
|
-
max_results: 50000
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
counter = 0
|
|
42
|
-
|
|
43
|
-
logins = {}
|
|
44
|
-
|
|
45
|
-
# build a hash from events which contains user_id and latest login date
|
|
46
|
-
client.get_events(options).each do |event|
|
|
47
|
-
key = "#{event.app_id}-#{event.user_id}"
|
|
48
|
-
|
|
49
|
-
unless logins[key]
|
|
50
|
-
logins[key] = {
|
|
51
|
-
app_id: event.app_id,
|
|
52
|
-
app_name: event.app_name,
|
|
53
|
-
user_id: event.user_id,
|
|
54
|
-
user_name: event.user_name,
|
|
55
|
-
last_login_at: event.created_at
|
|
56
|
-
}
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
CSV.open('last-login-by-app.csv', 'wb') do |csv|
|
|
61
|
-
puts "Exporting user logins to last-login-by-app.csv"
|
|
62
|
-
|
|
63
|
-
# header row
|
|
64
|
-
csv << ['app_id', 'app_name', 'user_id', 'user_name', 'last_login_at']
|
|
65
|
-
|
|
66
|
-
logins.each do |login|
|
|
67
|
-
csv << login[1].values
|
|
68
|
-
counter += 1
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
puts "Exported #{counter} user logins to last-login-by-app.csv"
|
data/examples/list-users.rb
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
require 'onelogin'
|
|
2
|
-
|
|
3
|
-
client = OneLogin::Api::Client.new(
|
|
4
|
-
client_id: 'ONELOGIN_CLIENT_ID',
|
|
5
|
-
client_secret:'ONELOGIN_CLIENT_SECRET',
|
|
6
|
-
region: 'us'
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
# List all of the users in your account
|
|
10
|
-
# the sdk uses a cursor to keep requesting
|
|
11
|
-
# chunks of users as you loop through
|
|
12
|
-
|
|
13
|
-
client.get_users.each do |user|
|
|
14
|
-
puts "#{user.id} - #{user.firstname} - #{user.email}"
|
|
15
|
-
end
|