onelogin 1.6.0 → 3.0.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +7 -4
- data/README.md +245 -484
- 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 -42
- 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 +401 -216
- data/.github/workflows/git-secrets-public.yml +0 -55
- data/.gitignore +0 -12
- data/.travis.yml +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -6
- data/examples/Gemfile +0 -3
- data/examples/Gemfile.lock +0 -25
- 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 -93
- 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/examples/rails-custom-login-page/.gitignore +0 -45
- data/examples/rails-custom-login-page/.ruby-version +0 -1
- data/examples/rails-custom-login-page/Gemfile +0 -57
- data/examples/rails-custom-login-page/Gemfile.lock +0 -212
- data/examples/rails-custom-login-page/README.md +0 -137
- data/examples/rails-custom-login-page/Rakefile +0 -6
- data/examples/rails-custom-login-page/app/assets/config/manifest.js +0 -3
- data/examples/rails-custom-login-page/app/assets/images/.keep +0 -0
- data/examples/rails-custom-login-page/app/assets/javascripts/application.js +0 -18
- data/examples/rails-custom-login-page/app/assets/javascripts/cable.js +0 -13
- data/examples/rails-custom-login-page/app/assets/javascripts/channels/.keep +0 -0
- data/examples/rails-custom-login-page/app/assets/javascripts/dashboard.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/javascripts/home.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/javascripts/sessions.coffee +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/application.css +0 -15
- data/examples/rails-custom-login-page/app/assets/stylesheets/dashboard.scss +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/home.scss +0 -3
- data/examples/rails-custom-login-page/app/assets/stylesheets/sessions.scss +0 -3
- data/examples/rails-custom-login-page/app/channels/application_cable/channel.rb +0 -4
- data/examples/rails-custom-login-page/app/channels/application_cable/connection.rb +0 -4
- data/examples/rails-custom-login-page/app/controllers/application_controller.rb +0 -23
- data/examples/rails-custom-login-page/app/controllers/concerns/.keep +0 -0
- data/examples/rails-custom-login-page/app/controllers/dashboard_controller.rb +0 -10
- data/examples/rails-custom-login-page/app/controllers/home_controller.rb +0 -5
- data/examples/rails-custom-login-page/app/controllers/sessions_controller.rb +0 -46
- data/examples/rails-custom-login-page/app/controllers/users_controller.rb +0 -120
- data/examples/rails-custom-login-page/app/helpers/application_helper.rb +0 -2
- data/examples/rails-custom-login-page/app/helpers/dashboard_helper.rb +0 -28
- data/examples/rails-custom-login-page/app/helpers/home_helper.rb +0 -2
- data/examples/rails-custom-login-page/app/helpers/sessions_helper.rb +0 -87
- data/examples/rails-custom-login-page/app/helpers/users_helper.rb +0 -3
- data/examples/rails-custom-login-page/app/jobs/application_job.rb +0 -2
- data/examples/rails-custom-login-page/app/mailers/application_mailer.rb +0 -4
- data/examples/rails-custom-login-page/app/models/application_record.rb +0 -3
- data/examples/rails-custom-login-page/app/models/concerns/.keep +0 -0
- data/examples/rails-custom-login-page/app/views/dashboard/index.html.erb +0 -43
- data/examples/rails-custom-login-page/app/views/home/index.html.erb +0 -272
- data/examples/rails-custom-login-page/app/views/layouts/application.html.erb +0 -31
- data/examples/rails-custom-login-page/app/views/layouts/mailer.html.erb +0 -13
- data/examples/rails-custom-login-page/app/views/layouts/mailer.text.erb +0 -1
- data/examples/rails-custom-login-page/app/views/users/_form.html.erb +0 -1
- data/examples/rails-custom-login-page/app/views/users/_user.json.jbuilder +0 -2
- data/examples/rails-custom-login-page/app/views/users/edit.html.erb +0 -33
- data/examples/rails-custom-login-page/app/views/users/index.html.erb +0 -33
- data/examples/rails-custom-login-page/app/views/users/index.json.jbuilder +0 -1
- data/examples/rails-custom-login-page/app/views/users/new.html.erb +0 -60
- data/examples/rails-custom-login-page/app/views/users/onboard.html.erb +0 -54
- data/examples/rails-custom-login-page/app/views/users/show.html.erb +0 -17
- data/examples/rails-custom-login-page/app/views/users/show.json.jbuilder +0 -1
- data/examples/rails-custom-login-page/bin/bundle +0 -3
- data/examples/rails-custom-login-page/bin/rails +0 -9
- data/examples/rails-custom-login-page/bin/rake +0 -9
- data/examples/rails-custom-login-page/bin/setup +0 -38
- data/examples/rails-custom-login-page/bin/spring +0 -17
- data/examples/rails-custom-login-page/bin/update +0 -29
- data/examples/rails-custom-login-page/bin/yarn +0 -11
- data/examples/rails-custom-login-page/config/application.rb +0 -18
- data/examples/rails-custom-login-page/config/boot.rb +0 -3
- data/examples/rails-custom-login-page/config/cable.yml +0 -10
- data/examples/rails-custom-login-page/config/database.yml +0 -25
- data/examples/rails-custom-login-page/config/environment.rb +0 -5
- data/examples/rails-custom-login-page/config/environments/development.rb +0 -54
- data/examples/rails-custom-login-page/config/environments/production.rb +0 -91
- data/examples/rails-custom-login-page/config/environments/test.rb +0 -42
- data/examples/rails-custom-login-page/config/initializers/application_controller_renderer.rb +0 -8
- data/examples/rails-custom-login-page/config/initializers/assets.rb +0 -14
- data/examples/rails-custom-login-page/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/rails-custom-login-page/config/initializers/cookies_serializer.rb +0 -5
- data/examples/rails-custom-login-page/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/rails-custom-login-page/config/initializers/inflections.rb +0 -16
- data/examples/rails-custom-login-page/config/initializers/mime_types.rb +0 -4
- data/examples/rails-custom-login-page/config/initializers/onelogin.rb +0 -6
- data/examples/rails-custom-login-page/config/initializers/wrap_parameters.rb +0 -14
- data/examples/rails-custom-login-page/config/locales/en.yml +0 -33
- data/examples/rails-custom-login-page/config/puma.rb +0 -56
- data/examples/rails-custom-login-page/config/routes.rb +0 -23
- data/examples/rails-custom-login-page/config/secrets.yml.sample +0 -38
- data/examples/rails-custom-login-page/config/spring.rb +0 -6
- data/examples/rails-custom-login-page/config.ru +0 -5
- data/examples/rails-custom-login-page/db/seeds.rb +0 -7
- data/examples/rails-custom-login-page/lib/assets/.keep +0 -0
- data/examples/rails-custom-login-page/lib/tasks/.keep +0 -0
- data/examples/rails-custom-login-page/package.json +0 -5
- data/examples/rails-custom-login-page/public/404.html +0 -67
- data/examples/rails-custom-login-page/public/422.html +0 -67
- data/examples/rails-custom-login-page/public/500.html +0 -66
- data/examples/rails-custom-login-page/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/rails-custom-login-page/public/apple-touch-icon.png +0 -0
- data/examples/rails-custom-login-page/public/favicon.ico +0 -0
- data/examples/rails-custom-login-page/public/robots.txt +0 -1
- data/examples/rails-custom-login-page/test/application_system_test_case.rb +0 -5
- data/examples/rails-custom-login-page/test/controllers/.keep +0 -0
- data/examples/rails-custom-login-page/test/controllers/dashboard_controller_test.rb +0 -9
- data/examples/rails-custom-login-page/test/controllers/home_controller_test.rb +0 -9
- data/examples/rails-custom-login-page/test/controllers/sessions_controller_test.rb +0 -7
- data/examples/rails-custom-login-page/test/controllers/users_controller_test.rb +0 -48
- data/examples/rails-custom-login-page/test/fixtures/.keep +0 -0
- data/examples/rails-custom-login-page/test/fixtures/files/.keep +0 -0
- data/examples/rails-custom-login-page/test/helpers/.keep +0 -0
- data/examples/rails-custom-login-page/test/integration/.keep +0 -0
- data/examples/rails-custom-login-page/test/mailers/.keep +0 -0
- data/examples/rails-custom-login-page/test/models/.keep +0 -0
- data/examples/rails-custom-login-page/test/system/.keep +0 -0
- data/examples/rails-custom-login-page/test/test_helper.rb +0 -9
- data/examples/rails-custom-login-page/vendor/.keep +0 -0
- data/lib/onelogin/api/apiexception.rb +0 -10
- data/lib/onelogin/api/client.rb +0 -2954
- data/lib/onelogin/api/cursor.rb +0 -114
- 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
@@ -1,57 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
git_source(:github) do |repo_name|
|
4
|
-
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
5
|
-
"https://github.com/#{repo_name}.git"
|
6
|
-
end
|
7
|
-
|
8
|
-
|
9
|
-
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
10
|
-
gem 'rails', '~> 5.1.4'
|
11
|
-
# Use sqlite3 as the database for Active Record
|
12
|
-
gem 'sqlite3'
|
13
|
-
# Use Puma as the app server
|
14
|
-
gem 'puma', '~> 3.12'
|
15
|
-
# Use SCSS for stylesheets
|
16
|
-
gem 'sass-rails', '~> 5.0'
|
17
|
-
# Use Uglifier as compressor for JavaScript assets
|
18
|
-
gem 'uglifier', '>= 1.3.0'
|
19
|
-
# See https://github.com/rails/execjs#readme for more supported runtimes
|
20
|
-
# gem 'therubyracer', platforms: :ruby
|
21
|
-
|
22
|
-
# Use CoffeeScript for .coffee assets and views
|
23
|
-
gem 'coffee-rails', '~> 4.2'
|
24
|
-
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
|
25
|
-
gem 'turbolinks', '~> 5'
|
26
|
-
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
27
|
-
gem 'jbuilder', '~> 2.5'
|
28
|
-
# Use Redis adapter to run Action Cable in production
|
29
|
-
# gem 'redis', '~> 3.0'
|
30
|
-
# Use ActiveModel has_secure_password
|
31
|
-
# gem 'bcrypt', '~> 3.1.7'
|
32
|
-
|
33
|
-
# Use Capistrano for deployment
|
34
|
-
# gem 'capistrano-rails', group: :development
|
35
|
-
|
36
|
-
gem 'onelogin', '~> 1.6.0'
|
37
|
-
gem 'jquery-rails'
|
38
|
-
|
39
|
-
group :development, :test do
|
40
|
-
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
41
|
-
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
|
42
|
-
# Adds support for Capybara system testing and selenium driver
|
43
|
-
gem 'capybara', '~> 2.13'
|
44
|
-
gem 'selenium-webdriver'
|
45
|
-
end
|
46
|
-
|
47
|
-
group :development do
|
48
|
-
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
|
49
|
-
gem 'web-console', '>= 3.3.0'
|
50
|
-
gem 'listen', '>= 3.0.5', '< 3.2'
|
51
|
-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
52
|
-
gem 'spring'
|
53
|
-
gem 'spring-watcher-listen', '~> 2.0.0'
|
54
|
-
end
|
55
|
-
|
56
|
-
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
57
|
-
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
@@ -1,212 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
actioncable (5.1.5)
|
5
|
-
actionpack (= 5.1.5)
|
6
|
-
nio4r (~> 2.0)
|
7
|
-
websocket-driver (~> 0.6.1)
|
8
|
-
actionmailer (5.1.5)
|
9
|
-
actionpack (= 5.1.5)
|
10
|
-
actionview (= 5.1.5)
|
11
|
-
activejob (= 5.1.5)
|
12
|
-
mail (~> 2.5, >= 2.5.4)
|
13
|
-
rails-dom-testing (~> 2.0)
|
14
|
-
actionpack (5.1.5)
|
15
|
-
actionview (= 5.1.5)
|
16
|
-
activesupport (= 5.1.5)
|
17
|
-
rack (~> 2.0)
|
18
|
-
rack-test (>= 0.6.3)
|
19
|
-
rails-dom-testing (~> 2.0)
|
20
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
21
|
-
actionview (5.1.5)
|
22
|
-
activesupport (= 5.1.5)
|
23
|
-
builder (~> 3.1)
|
24
|
-
erubi (~> 1.4)
|
25
|
-
rails-dom-testing (~> 2.0)
|
26
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
27
|
-
activejob (5.1.5)
|
28
|
-
activesupport (= 5.1.5)
|
29
|
-
globalid (>= 0.3.6)
|
30
|
-
activemodel (5.1.5)
|
31
|
-
activesupport (= 5.1.5)
|
32
|
-
activerecord (5.1.5)
|
33
|
-
activemodel (= 5.1.5)
|
34
|
-
activesupport (= 5.1.5)
|
35
|
-
arel (~> 8.0)
|
36
|
-
activesupport (5.1.5)
|
37
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
38
|
-
i18n (~> 0.7)
|
39
|
-
minitest (~> 5.1)
|
40
|
-
tzinfo (~> 1.1)
|
41
|
-
addressable (2.5.2)
|
42
|
-
public_suffix (>= 2.0.2, < 4.0)
|
43
|
-
arel (8.0.0)
|
44
|
-
bindex (0.5.0)
|
45
|
-
builder (3.2.3)
|
46
|
-
byebug (10.0.1)
|
47
|
-
capybara (2.18.0)
|
48
|
-
addressable
|
49
|
-
mini_mime (>= 0.1.3)
|
50
|
-
nokogiri (>= 1.3.3)
|
51
|
-
rack (>= 1.0.0)
|
52
|
-
rack-test (>= 0.5.4)
|
53
|
-
xpath (>= 2.0, < 4.0)
|
54
|
-
childprocess (0.9.0)
|
55
|
-
ffi (~> 1.0, >= 1.0.11)
|
56
|
-
coffee-rails (4.2.2)
|
57
|
-
coffee-script (>= 2.2.0)
|
58
|
-
railties (>= 4.0.0)
|
59
|
-
coffee-script (2.4.1)
|
60
|
-
coffee-script-source
|
61
|
-
execjs
|
62
|
-
coffee-script-source (1.12.2)
|
63
|
-
concurrent-ruby (1.1.5)
|
64
|
-
crass (1.0.5)
|
65
|
-
erubi (1.7.1)
|
66
|
-
execjs (2.7.0)
|
67
|
-
ffi (1.11.1)
|
68
|
-
globalid (0.4.1)
|
69
|
-
activesupport (>= 4.2.0)
|
70
|
-
httparty (0.18.1)
|
71
|
-
mime-types (~> 3.0)
|
72
|
-
multi_xml (>= 0.5.2)
|
73
|
-
i18n (0.9.5)
|
74
|
-
concurrent-ruby (~> 1.0)
|
75
|
-
jbuilder (2.7.0)
|
76
|
-
activesupport (>= 4.2.0)
|
77
|
-
multi_json (>= 1.2)
|
78
|
-
jquery-rails (4.3.1)
|
79
|
-
rails-dom-testing (>= 1, < 3)
|
80
|
-
railties (>= 4.2.0)
|
81
|
-
thor (>= 0.14, < 2.0)
|
82
|
-
listen (3.1.5)
|
83
|
-
rb-fsevent (~> 0.9, >= 0.9.4)
|
84
|
-
rb-inotify (~> 0.9, >= 0.9.7)
|
85
|
-
ruby_dep (~> 1.2)
|
86
|
-
loofah (2.3.1)
|
87
|
-
crass (~> 1.0.2)
|
88
|
-
nokogiri (>= 1.5.9)
|
89
|
-
mail (2.7.0)
|
90
|
-
mini_mime (>= 0.1.1)
|
91
|
-
method_source (0.9.0)
|
92
|
-
mime-types (3.3.1)
|
93
|
-
mime-types-data (~> 3.2015)
|
94
|
-
mime-types-data (3.2020.1104)
|
95
|
-
mini_mime (1.0.0)
|
96
|
-
mini_portile2 (2.4.0)
|
97
|
-
minitest (5.11.3)
|
98
|
-
multi_json (1.13.1)
|
99
|
-
multi_xml (0.6.0)
|
100
|
-
nio4r (2.3.0)
|
101
|
-
nokogiri (1.10.4)
|
102
|
-
mini_portile2 (~> 2.4.0)
|
103
|
-
onelogin (1.6.0)
|
104
|
-
httparty (>= 0.13.7)
|
105
|
-
nokogiri (>= 1.6.3.1)
|
106
|
-
public_suffix (3.0.2)
|
107
|
-
puma (3.12.2)
|
108
|
-
rack (2.0.8)
|
109
|
-
rack-test (0.8.3)
|
110
|
-
rack (>= 1.0, < 3)
|
111
|
-
rails (5.1.5)
|
112
|
-
actioncable (= 5.1.5)
|
113
|
-
actionmailer (= 5.1.5)
|
114
|
-
actionpack (= 5.1.5)
|
115
|
-
actionview (= 5.1.5)
|
116
|
-
activejob (= 5.1.5)
|
117
|
-
activemodel (= 5.1.5)
|
118
|
-
activerecord (= 5.1.5)
|
119
|
-
activesupport (= 5.1.5)
|
120
|
-
bundler (>= 1.3.0)
|
121
|
-
railties (= 5.1.5)
|
122
|
-
sprockets-rails (>= 2.0.0)
|
123
|
-
rails-dom-testing (2.0.3)
|
124
|
-
activesupport (>= 4.2.0)
|
125
|
-
nokogiri (>= 1.6)
|
126
|
-
rails-html-sanitizer (1.0.4)
|
127
|
-
loofah (~> 2.2, >= 2.2.2)
|
128
|
-
railties (5.1.5)
|
129
|
-
actionpack (= 5.1.5)
|
130
|
-
activesupport (= 5.1.5)
|
131
|
-
method_source
|
132
|
-
rake (>= 0.8.7)
|
133
|
-
thor (>= 0.18.1, < 2.0)
|
134
|
-
rake (12.3.1)
|
135
|
-
rb-fsevent (0.10.3)
|
136
|
-
rb-inotify (0.9.10)
|
137
|
-
ffi (>= 0.5.0, < 2)
|
138
|
-
ruby_dep (1.5.0)
|
139
|
-
rubyzip (1.3.0)
|
140
|
-
sass (3.5.5)
|
141
|
-
sass-listen (~> 4.0.0)
|
142
|
-
sass-listen (4.0.0)
|
143
|
-
rb-fsevent (~> 0.9, >= 0.9.4)
|
144
|
-
rb-inotify (~> 0.9, >= 0.9.7)
|
145
|
-
sass-rails (5.0.7)
|
146
|
-
railties (>= 4.0.0, < 6)
|
147
|
-
sass (~> 3.1)
|
148
|
-
sprockets (>= 2.8, < 4.0)
|
149
|
-
sprockets-rails (>= 2.0, < 4.0)
|
150
|
-
tilt (>= 1.1, < 3)
|
151
|
-
selenium-webdriver (3.11.0)
|
152
|
-
childprocess (~> 0.5)
|
153
|
-
rubyzip (~> 1.2)
|
154
|
-
spring (2.0.2)
|
155
|
-
activesupport (>= 4.2)
|
156
|
-
spring-watcher-listen (2.0.1)
|
157
|
-
listen (>= 2.7, < 4.0)
|
158
|
-
spring (>= 1.2, < 3.0)
|
159
|
-
sprockets (3.7.2)
|
160
|
-
concurrent-ruby (~> 1.0)
|
161
|
-
rack (> 1, < 3)
|
162
|
-
sprockets-rails (3.2.1)
|
163
|
-
actionpack (>= 4.0)
|
164
|
-
activesupport (>= 4.0)
|
165
|
-
sprockets (>= 3.0.0)
|
166
|
-
sqlite3 (1.3.13)
|
167
|
-
thor (0.20.0)
|
168
|
-
thread_safe (0.3.6)
|
169
|
-
tilt (2.0.8)
|
170
|
-
turbolinks (5.1.0)
|
171
|
-
turbolinks-source (~> 5.1)
|
172
|
-
turbolinks-source (5.1.0)
|
173
|
-
tzinfo (1.2.5)
|
174
|
-
thread_safe (~> 0.1)
|
175
|
-
uglifier (4.1.8)
|
176
|
-
execjs (>= 0.3.0, < 3)
|
177
|
-
web-console (3.5.1)
|
178
|
-
actionview (>= 5.0)
|
179
|
-
activemodel (>= 5.0)
|
180
|
-
bindex (>= 0.4.0)
|
181
|
-
railties (>= 5.0)
|
182
|
-
websocket-driver (0.6.5)
|
183
|
-
websocket-extensions (>= 0.1.0)
|
184
|
-
websocket-extensions (0.1.3)
|
185
|
-
xpath (3.0.0)
|
186
|
-
nokogiri (~> 1.8)
|
187
|
-
|
188
|
-
PLATFORMS
|
189
|
-
ruby
|
190
|
-
|
191
|
-
DEPENDENCIES
|
192
|
-
byebug
|
193
|
-
capybara (~> 2.13)
|
194
|
-
coffee-rails (~> 4.2)
|
195
|
-
jbuilder (~> 2.5)
|
196
|
-
jquery-rails
|
197
|
-
listen (>= 3.0.5, < 3.2)
|
198
|
-
onelogin (~> 1.5.0)
|
199
|
-
puma (~> 3.12)
|
200
|
-
rails (~> 5.1.4)
|
201
|
-
sass-rails (~> 5.0)
|
202
|
-
selenium-webdriver
|
203
|
-
spring
|
204
|
-
spring-watcher-listen (~> 2.0.0)
|
205
|
-
sqlite3
|
206
|
-
turbolinks (~> 5)
|
207
|
-
tzinfo-data
|
208
|
-
uglifier (>= 1.3.0)
|
209
|
-
web-console (>= 3.3.0)
|
210
|
-
|
211
|
-
BUNDLED WITH
|
212
|
-
1.17.3
|
@@ -1,137 +0,0 @@
|
|
1
|
-
# Customized Login Page
|
2
|
-
|
3
|
-
This sample is a default [Ruby on Rails 5](http://rubyonrails.org/) app that makes use of the OneLogin ruby sdk for authenticating users.
|
4
|
-
|
5
|
-
It is the recommended approach when building a customized login flow where you want complete control
|
6
|
-
over the look & feel.
|
7
|
-
|
8
|
-
The downside to this approach is that you have to implement MFA and password resets etc yourself. However we do have the APIs for these actions available and have demonstrated how to use them in this app.
|
9
|
-
|
10
|
-
If you want a standards based, out of the box way to authenticate users then we recommend you use [our OpenId Connect implementation](https://github.com/onelogin/onelogin-oidc-ruby).
|
11
|
-
|
12
|
-
## Get Started
|
13
|
-
|
14
|
-
The sample tries to keep everything as simple as possible so only
|
15
|
-
implements
|
16
|
-
* Login - Authenticate users in a single request to OneLogin with out any redirects
|
17
|
-
* MFA - Does MFA verification if required
|
18
|
-
* Password Reset with user verification via MFA
|
19
|
-
* Self sign Up / Create a new user
|
20
|
-
* Onboard / Activate a user
|
21
|
-
* User Apps - List apps available to a user and provides SSO links
|
22
|
-
* User Roles - Lists a users roles
|
23
|
-
* Logout - destroying the local session and revoking the token at OneLogin
|
24
|
-
|
25
|
-
In order to run this sample you need API credentials for a OneLogin account. If you don't have a OneLogin developer account [you can sign up here](https://www.onelogin.com/developer-signup).
|
26
|
-
|
27
|
-
1. Clone this repo
|
28
|
-
|
29
|
-
```sh
|
30
|
-
git clone https://github.com/onelogin/onelogin-ruby-sdk.git
|
31
|
-
```
|
32
|
-
|
33
|
-
2. Move to the rails example and install the required gems
|
34
|
-
```sh
|
35
|
-
cd onelogin-ruby-sdk/examples/rails-custom-login-page && bundle install
|
36
|
-
```
|
37
|
-
|
38
|
-
3. Rename `config/secrets.yml.sample` to `config/secrets.yml` and update with your OneLogin API credentials, region and subdomain.
|
39
|
-
|
40
|
-
If you are using a custom domain instance, set it
|
41
|
-
in order to be used for the login demo.
|
42
|
-
|
43
|
-
If you want to set the cookie via post-form set
|
44
|
-
COOKIE_VIA_POST_FORM to true, otherwise the cookie
|
45
|
-
will be set via javascript via the makeCors method
|
46
|
-
described later.
|
47
|
-
|
48
|
-
```yaml
|
49
|
-
development:
|
50
|
-
secret_key_base: xxx
|
51
|
-
ONELOGIN_CLIENT_ID: xxx
|
52
|
-
ONELOGIN_CLIENT_SECRET: xxx
|
53
|
-
ONELOGIN_REGION: us
|
54
|
-
ONELOGIN_SUBDOMAIN: xxx
|
55
|
-
CUSTOM_DOMAIN: xxx
|
56
|
-
COOKIE_VIA_POST_FORM: true
|
57
|
-
```
|
58
|
-
4. Run the sample and browse to `http://localhost:3000`
|
59
|
-
```sh
|
60
|
-
rails s
|
61
|
-
```
|
62
|
-
|
63
|
-
The `/dashboard` route renders a protected page to prove the authentication works and creates a session. You will need to be authenticated to view it. If you are not authenticate you will be redirected back to the login page.
|
64
|
-
|
65
|
-
### Authenticate the user
|
66
|
-
|
67
|
-
*helpers/sessions_helper.rb*
|
68
|
-
```ruby
|
69
|
-
response = api_client.create_session_login_token({
|
70
|
-
'username_or_email' => username,
|
71
|
-
'password' => password,
|
72
|
-
'subdomain' => ONELOGIN_SUBDOMAIN,
|
73
|
-
},
|
74
|
-
request.base_url # included for CORS session cookie request
|
75
|
-
)
|
76
|
-
```
|
77
|
-
|
78
|
-
### Verify MFA
|
79
|
-
|
80
|
-
*helpers/sessions_helper.rb*
|
81
|
-
```ruby
|
82
|
-
response = api_client.get_session_token_verified(
|
83
|
-
device_id,
|
84
|
-
session[:state_token],
|
85
|
-
otp_token,
|
86
|
-
request.base_url
|
87
|
-
)
|
88
|
-
```
|
89
|
-
|
90
|
-
### Destroy the session
|
91
|
-
|
92
|
-
*helpers/sessions_helper.rb*
|
93
|
-
```ruby
|
94
|
-
api_client.log_user_out(current_user_id)
|
95
|
-
session.delete(:user)
|
96
|
-
```
|
97
|
-
|
98
|
-
### Make CORS request to establish SSO session
|
99
|
-
|
100
|
-
Using the `session_token` returned from the `session_controller` after a new login or successful MFA verification.
|
101
|
-
|
102
|
-
*views/home/index.html.erb*
|
103
|
-
```javascript
|
104
|
-
function makeCors(session_token) {
|
105
|
-
var xhr = new XMLHttpRequest();
|
106
|
-
xhr.withCredentials = true;
|
107
|
-
method = "POST";
|
108
|
-
var url = "https://" + ONELOGIN_SUBDOMAIN + ".onelogin.com/session_via_api_token";
|
109
|
-
// var url = "https://" + CUSTOM_DOMAIN + "/session_via_api_token";
|
110
|
-
xhr.open(method, url, true);
|
111
|
-
xhr.setRequestHeader("Content-Type", "application/json");
|
112
|
-
body = {"session_token": session_token};
|
113
|
-
xhr.send(JSON.stringify(body));
|
114
|
-
};
|
115
|
-
```
|
116
|
-
|
117
|
-
### Make form-based request to establish SSO session
|
118
|
-
```html
|
119
|
-
<!doctype html>
|
120
|
-
<html>
|
121
|
-
<head>
|
122
|
-
<meta charset="utf-8">
|
123
|
-
</head>
|
124
|
-
<body>
|
125
|
-
<p>Auth API Test</p>
|
126
|
-
<form action=
|
127
|
-
"https://{onelogin_instance}/session_via_api_token" method="POST">
|
128
|
-
<input type="hidden" name="session_token" value="{your session token value}">
|
129
|
-
<input type="submit" placeholder="GO">
|
130
|
-
<input id="auth_token" type="hidden">
|
131
|
-
</form>
|
132
|
-
</body>
|
133
|
-
</html>
|
134
|
-
|
135
|
-
where onelogin_instance is a custom domain or
|
136
|
-
{subdomain}.onelogin.com
|
137
|
-
```
|
File without changes
|
@@ -1,18 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
|
5
|
-
// vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require rails-ujs
|
14
|
-
//= require turbolinks
|
15
|
-
//= require_tree .
|
16
|
-
//= require jquery
|
17
|
-
//= require jquery_ujs
|
18
|
-
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
-
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
-
//
|
4
|
-
//= require action_cable
|
5
|
-
//= require_self
|
6
|
-
//= require_tree ./channels
|
7
|
-
|
8
|
-
(function() {
|
9
|
-
this.App || (this.App = {});
|
10
|
-
|
11
|
-
App.cable = ActionCable.createConsumer();
|
12
|
-
|
13
|
-
}).call(this);
|
File without changes
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
|
6
|
-
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'onelogin'
|
2
|
-
|
3
|
-
class ApplicationController < ActionController::Base
|
4
|
-
protect_from_forgery with: :exception
|
5
|
-
include SessionsHelper
|
6
|
-
|
7
|
-
def require_current_user
|
8
|
-
if current_user
|
9
|
-
return true
|
10
|
-
else
|
11
|
-
redirect_to root_url, error: "Please sign in."
|
12
|
-
return false
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def api_client
|
17
|
-
@api_client ||= OneLogin::Api::Client.new(
|
18
|
-
client_id: ONELOGIN_CLIENT_ID,
|
19
|
-
client_secret: ONELOGIN_CLIENT_SECRET,
|
20
|
-
region: ONELOGIN_REGION
|
21
|
-
)
|
22
|
-
end
|
23
|
-
end
|
File without changes
|
@@ -1,46 +0,0 @@
|
|
1
|
-
class SessionsController < ApplicationController
|
2
|
-
def new
|
3
|
-
response = log_in(params['username'], params['password'])
|
4
|
-
status = response[:error] ? :unauthorized : :ok
|
5
|
-
|
6
|
-
render json: response, status: status
|
7
|
-
end
|
8
|
-
|
9
|
-
def verify
|
10
|
-
response = verify_mfa(params['device_id'], params['otp_token'])
|
11
|
-
status = response ? :ok : :unauthorized
|
12
|
-
|
13
|
-
render json: response, status: status
|
14
|
-
end
|
15
|
-
|
16
|
-
# Checks for user and gets MFA devices
|
17
|
-
# available to verify token before
|
18
|
-
# password reset is completed
|
19
|
-
def forgot_password
|
20
|
-
user = validate_user(params['forgot_username'])
|
21
|
-
|
22
|
-
devices = get_mfa_devices(user.id)
|
23
|
-
|
24
|
-
status = user ? :ok : :not_found
|
25
|
-
|
26
|
-
render json: devices, status: status
|
27
|
-
end
|
28
|
-
|
29
|
-
# Verify MFA token and then update password
|
30
|
-
def reset_password
|
31
|
-
if verify_token(params['reset_device_id'], params['reset_otp_token'])
|
32
|
-
status = :ok
|
33
|
-
response = set_password(session[:user_id], params['new_password'])
|
34
|
-
else
|
35
|
-
status = :unauthorized
|
36
|
-
response = 'Invalid token'
|
37
|
-
end
|
38
|
-
|
39
|
-
render json: response, status: status
|
40
|
-
end
|
41
|
-
|
42
|
-
def destroy
|
43
|
-
log_out
|
44
|
-
redirect_to root_url
|
45
|
-
end
|
46
|
-
end
|