Class: FusionAuth::FusionAuthClient
- Inherits:
-
Object
- Object
- FusionAuth::FusionAuthClient
- Defined in:
- lib/fusionauth/fusionauth_client.rb
Overview
This class is the the Ruby client library for the FusionAuth CIAM Platform https://fusionauth.io
Each method on this class calls one of the APIs for FusionAuth. In most cases, the methods will take either a Hash, an OpenStruct or any object that can be safely converted to JSON that conforms to the FusionAuth API interface. Likewise, most methods will return an OpenStruct that contains the response JSON from FusionAuth.
noinspection RubyInstanceMethodNamingConvention,RubyTooManyMethodsInspection,RubyParameterNamingConvention
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
Instance Method Summary collapse
-
#action_user(actionee_user_id, request) ⇒ FusionAuth::ClientResponse
Takes an action on a user.
-
#add_user_to_family(family_id, request) ⇒ FusionAuth::ClientResponse
Adds a user to an existing family.
-
#cancel_action(action_id, request) ⇒ FusionAuth::ClientResponse
Cancels the user action.
-
#change_password(change_password_id, request) ⇒ FusionAuth::ClientResponse
Changes a user’s password using the change password Id.
-
#change_password_by_identity(request) ⇒ FusionAuth::ClientResponse
Changes a user’s password using their identity (login id and password).
-
#comment_on_user(request) ⇒ FusionAuth::ClientResponse
Adds a comment to the user’s account.
-
#create_application(application_id, request) ⇒ FusionAuth::ClientResponse
Creates an application.
-
#create_application_role(application_id, role_id, request) ⇒ FusionAuth::ClientResponse
Creates a new role for an application.
-
#create_audit_log(request) ⇒ FusionAuth::ClientResponse
Creates an audit log with the message and user name (usually an email).
-
#create_consent(consent_id, request) ⇒ FusionAuth::ClientResponse
Creates a user consent type.
-
#create_email_template(email_template_id, request) ⇒ FusionAuth::ClientResponse
Creates an email template.
-
#create_family(family_id, request) ⇒ FusionAuth::ClientResponse
Creates a family with the user id in the request as the owner and sole member of the family.
-
#create_group(group_id, request) ⇒ FusionAuth::ClientResponse
Creates a group.
-
#create_group_members(request) ⇒ FusionAuth::ClientResponse
Creates a member in a group.
-
#create_identity_provider(identity_provider_id, request) ⇒ FusionAuth::ClientResponse
Creates an identity provider.
-
#create_lambda(lambda_id, request) ⇒ FusionAuth::ClientResponse
Creates a Lambda.
-
#create_tenant(tenant_id, request) ⇒ FusionAuth::ClientResponse
Creates a tenant.
-
#create_theme(theme_id, request) ⇒ FusionAuth::ClientResponse
Creates a Theme.
-
#create_user(user_id, request) ⇒ FusionAuth::ClientResponse
Creates a user.
-
#create_user_action(user_action_id, request) ⇒ FusionAuth::ClientResponse
Creates a user action.
-
#create_user_action_reason(user_action_reason_id, request) ⇒ FusionAuth::ClientResponse
Creates a user reason.
-
#create_user_consent(user_consent_id, request) ⇒ FusionAuth::ClientResponse
Creates a single User consent.
-
#create_webhook(webhook_id, request) ⇒ FusionAuth::ClientResponse
Creates a webhook.
-
#deactivate_application(application_id) ⇒ FusionAuth::ClientResponse
Deactivates the application with the given Id.
-
#deactivate_user(user_id) ⇒ FusionAuth::ClientResponse
Deactivates the user with the given Id.
-
#deactivate_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Deactivates the user action with the given Id.
-
#deactivate_users(user_ids) ⇒ FusionAuth::ClientResponse
Deactivates the users with the given ids.
-
#delete_application(application_id) ⇒ FusionAuth::ClientResponse
Hard deletes an application.
-
#delete_application_role(application_id, role_id) ⇒ FusionAuth::ClientResponse
Hard deletes an application role.
-
#delete_consent(consent_id) ⇒ FusionAuth::ClientResponse
Deletes the consent for the given Id.
-
#delete_email_template(email_template_id) ⇒ FusionAuth::ClientResponse
Deletes the email template for the given Id.
-
#delete_group(group_id) ⇒ FusionAuth::ClientResponse
Deletes the group for the given Id.
-
#delete_group_members(request) ⇒ FusionAuth::ClientResponse
Removes users as members of a group.
-
#delete_identity_provider(identity_provider_id) ⇒ FusionAuth::ClientResponse
Deletes the identity provider for the given Id.
-
#delete_key(key_od) ⇒ FusionAuth::ClientResponse
Deletes the key for the given Id.
-
#delete_lambda(lambda_id) ⇒ FusionAuth::ClientResponse
Deletes the lambda for the given Id.
-
#delete_registration(user_id, application_id) ⇒ FusionAuth::ClientResponse
Deletes the user registration for the given user and application.
-
#delete_tenant(tenant_id) ⇒ FusionAuth::ClientResponse
Deletes the tenant for the given Id.
-
#delete_theme(theme_id) ⇒ FusionAuth::ClientResponse
Deletes the theme for the given Id.
-
#delete_user(user_id) ⇒ FusionAuth::ClientResponse
Deletes the user for the given Id.
-
#delete_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Deletes the user action for the given Id.
-
#delete_user_action_reason(user_action_reason_id) ⇒ FusionAuth::ClientResponse
Deletes the user action reason for the given Id.
-
#delete_users(request) ⇒ FusionAuth::ClientResponse
Deletes the users with the given ids.
-
#delete_webhook(webhook_id) ⇒ FusionAuth::ClientResponse
Deletes the webhook for the given Id.
-
#disable_two_factor(user_id, code) ⇒ FusionAuth::ClientResponse
Disable Two Factor authentication for a user.
-
#enable_two_factor(user_id, request) ⇒ FusionAuth::ClientResponse
Enable Two Factor authentication for a user.
-
#exchange_refresh_token_for_jwt(request) ⇒ FusionAuth::ClientResponse
Exchange a refresh token for a new JWT.
-
#forgot_password(request) ⇒ FusionAuth::ClientResponse
Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
-
#generate_email_verification_id(email) ⇒ FusionAuth::ClientResponse
Generate a new Email Verification Id to be used with the Verify Email API.
-
#generate_key(key_id, request) ⇒ FusionAuth::ClientResponse
Generate a new RSA or EC key pair or an HMAC secret.
-
#generate_registration_verification_id(email, application_id) ⇒ FusionAuth::ClientResponse
Generate a new Application Registration Verification Id to be used with the Verify Registration API.
-
#generate_two_factor_secret ⇒ FusionAuth::ClientResponse
Generate a Two Factor secret that can be used to enable Two Factor authentication for a User.
-
#generate_two_factor_secret_using_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse
Generate a Two Factor secret that can be used to enable Two Factor authentication for a User.
-
#identity_provider_login(request) ⇒ FusionAuth::ClientResponse
Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other login systems.
-
#import_key(key_id, request) ⇒ FusionAuth::ClientResponse
Import an existing RSA or EC key pair or an HMAC secret.
-
#import_users(request) ⇒ FusionAuth::ClientResponse
Bulk imports multiple users.
-
#initialize(api_key, base_url) ⇒ FusionAuthClient
constructor
A new instance of FusionAuthClient.
-
#issue_jwt(application_id, encoded_jwt) ⇒ FusionAuth::ClientResponse
Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid.
-
#login(request) ⇒ FusionAuth::ClientResponse
Authenticates a user to FusionAuth.
-
#login_ping(user_id, application_id, caller_ip_address) ⇒ FusionAuth::ClientResponse
Sends a ping to FusionAuth indicating that the user was automatically logged into an application.
-
#logout(global, refresh_token) ⇒ FusionAuth::ClientResponse
The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token stored.
-
#lookup_identity_provider(domain) ⇒ FusionAuth::ClientResponse
Retrieves the identity provider for the given domain.
-
#modify_action(action_id, request) ⇒ FusionAuth::ClientResponse
Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the action.
-
#passwordless_login(request) ⇒ FusionAuth::ClientResponse
Complete a login request using a passwordless code.
-
#reactivate_application(application_id) ⇒ FusionAuth::ClientResponse
Reactivates the application with the given Id.
-
#reactivate_user(user_id) ⇒ FusionAuth::ClientResponse
Reactivates the user with the given Id.
-
#reactivate_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Reactivates the user action with the given Id.
-
#reconcile_jwt(request) ⇒ FusionAuth::ClientResponse
Reconcile a User to FusionAuth using JWT issued from another Identity Provider.
-
#refresh_user_search_index ⇒ FusionAuth::ClientResponse
Request a refresh of the User search index.
-
#register(user_id, request) ⇒ FusionAuth::ClientResponse
Registers a user for an application.
-
#remove_user_from_family(family_id, user_id) ⇒ FusionAuth::ClientResponse
Removes a user from the family with the given id.
-
#resend_email_verification(email) ⇒ FusionAuth::ClientResponse
Re-sends the verification email to the user.
-
#resend_registration_verification(email, application_id) ⇒ FusionAuth::ClientResponse
Re-sends the application registration verification email to the user.
-
#retrieve_action(action_id) ⇒ FusionAuth::ClientResponse
Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.
-
#retrieve_actions(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id.
-
#retrieve_actions_preventing_login(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id that are currently preventing the User from logging in.
-
#retrieve_active_actions(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id that are currently active.
-
#retrieve_application(application_id) ⇒ FusionAuth::ClientResponse
Retrieves the application for the given id or all of the applications if the id is null.
-
#retrieve_applications ⇒ FusionAuth::ClientResponse
Retrieves all of the applications.
-
#retrieve_audit_log(audit_log_id) ⇒ FusionAuth::ClientResponse
Retrieves a single audit log for the given Id.
-
#retrieve_consent(consent_id) ⇒ FusionAuth::ClientResponse
Retrieves the Consent for the given Id.
-
#retrieve_consents ⇒ FusionAuth::ClientResponse
Retrieves all of the consent.
-
#retrieve_daily_active_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the daily active user report between the two instants.
-
#retrieve_email_template(email_template_id) ⇒ FusionAuth::ClientResponse
Retrieves the email template for the given Id.
-
#retrieve_email_template_preview(request) ⇒ FusionAuth::ClientResponse
Creates a preview of the email template provided in the request.
-
#retrieve_email_templates ⇒ FusionAuth::ClientResponse
Retrieves all of the email templates.
-
#retrieve_event_log(event_log_id) ⇒ FusionAuth::ClientResponse
Retrieves a single event log for the given Id.
-
#retrieve_families(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the families that a user belongs to.
-
#retrieve_family_members_by_family_id(family_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the members of a family by the unique Family Id.
-
#retrieve_group(group_id) ⇒ FusionAuth::ClientResponse
Retrieves the group for the given Id.
-
#retrieve_groups ⇒ FusionAuth::ClientResponse
Retrieves all of the groups.
-
#retrieve_identity_provider(identity_provider_id) ⇒ FusionAuth::ClientResponse
Retrieves the identity provider for the given id or all of the identity providers if the id is null.
-
#retrieve_identity_providers ⇒ FusionAuth::ClientResponse
Retrieves all of the identity providers.
-
#retrieve_inactive_actions(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id that are currently inactive.
-
#retrieve_inactive_applications ⇒ FusionAuth::ClientResponse
Retrieves all of the applications that are currently inactive.
-
#retrieve_inactive_user_actions ⇒ FusionAuth::ClientResponse
Retrieves all of the user actions that are currently inactive.
-
#retrieve_integration ⇒ FusionAuth::ClientResponse
Retrieves the available integrations.
-
#retrieve_jwt_public_key(key_id) ⇒ FusionAuth::ClientResponse
Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid).
-
#retrieve_jwt_public_key_by_application_id(application_id) ⇒ FusionAuth::ClientResponse
Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id.
-
#retrieve_jwt_public_keys ⇒ FusionAuth::ClientResponse
Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT).
-
#retrieve_key(key_id) ⇒ FusionAuth::ClientResponse
Retrieves the key for the given Id.
-
#retrieve_keys ⇒ FusionAuth::ClientResponse
Retrieves all of the keys.
-
#retrieve_lambda(lambda_id) ⇒ FusionAuth::ClientResponse
Retrieves the lambda for the given Id.
-
#retrieve_lambdas ⇒ FusionAuth::ClientResponse
Retrieves all of the lambdas.
-
#retrieve_lambdas_by_type(type) ⇒ FusionAuth::ClientResponse
Retrieves all of the lambdas for the provided type.
-
#retrieve_login_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the login report between the two instants.
-
#retrieve_monthly_active_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the monthly active user report between the two instants.
-
#retrieve_oauth_configuration(application_id) ⇒ FusionAuth::ClientResponse
Retrieves the Oauth2 configuration for the application for the given Application Id.
-
#retrieve_password_validation_rules ⇒ FusionAuth::ClientResponse
Retrieves the password validation rules for a specific tenant.
-
#retrieve_password_validation_rules_with_tenant_id(tenant_id) ⇒ FusionAuth::ClientResponse
Retrieves the password validation rules for a specific tenant.
-
#retrieve_pending_children(parent_email) ⇒ FusionAuth::ClientResponse
Retrieves all of the children for the given parent email address.
-
#retrieve_recent_logins(offset, limit) ⇒ FusionAuth::ClientResponse
Retrieves the last number of login records.
-
#retrieve_refresh_tokens(user_id) ⇒ FusionAuth::ClientResponse
Retrieves the refresh tokens that belong to the user with the given Id.
-
#retrieve_registration(user_id, application_id) ⇒ FusionAuth::ClientResponse
Retrieves the user registration for the user with the given id and the given application id.
-
#retrieve_registration_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the registration report between the two instants.
-
#retrieve_system_configuration ⇒ FusionAuth::ClientResponse
Retrieves the system configuration.
-
#retrieve_tenant(tenant_id) ⇒ FusionAuth::ClientResponse
Retrieves the tenant for the given Id.
-
#retrieve_tenants ⇒ FusionAuth::ClientResponse
Retrieves all of the tenants.
-
#retrieve_theme(theme_id) ⇒ FusionAuth::ClientResponse
Retrieves the theme for the given Id.
-
#retrieve_themes ⇒ FusionAuth::ClientResponse
Retrieves all of the themes.
-
#retrieve_total_report ⇒ FusionAuth::ClientResponse
Retrieves the totals report.
-
#retrieve_user(user_id) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given Id.
-
#retrieve_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Retrieves the user action for the given Id.
-
#retrieve_user_action_reason(user_action_reason_id) ⇒ FusionAuth::ClientResponse
Retrieves the user action reason for the given Id.
-
#retrieve_user_action_reasons ⇒ FusionAuth::ClientResponse
Retrieves all the user action reasons.
-
#retrieve_user_actions ⇒ FusionAuth::ClientResponse
Retrieves all of the user actions.
-
#retrieve_user_by_change_password_id(change_password_id) ⇒ FusionAuth::ClientResponse
Retrieves the user by a change password Id.
-
#retrieve_user_by_email(email) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given email.
-
#retrieve_user_by_login_id(login_id) ⇒ FusionAuth::ClientResponse
Retrieves the user for the loginId.
-
#retrieve_user_by_username(username) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given username.
-
#retrieve_user_by_verification_id(verification_id) ⇒ FusionAuth::ClientResponse
Retrieves the user by a verificationId.
-
#retrieve_user_comments(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the comments for the user with the given Id.
-
#retrieve_user_consent(user_consent_id) ⇒ FusionAuth::ClientResponse
Retrieve a single User consent by Id.
-
#retrieve_user_consents(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the consents for a User.
-
#retrieve_user_login_report(application_id, user_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the login report between the two instants for a particular user by Id.
-
#retrieve_user_login_report_by_login_id(application_id, login_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the login report between the two instants for a particular user by login Id.
-
#retrieve_user_recent_logins(user_id, offset, limit) ⇒ FusionAuth::ClientResponse
Retrieves the last number of login records for a user.
-
#retrieve_user_using_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given Id.
-
#retrieve_webhook(webhook_id) ⇒ FusionAuth::ClientResponse
Retrieves the webhook for the given Id.
-
#retrieve_webhooks ⇒ FusionAuth::ClientResponse
Retrieves all the webhooks.
-
#revoke_refresh_token(token, user_id, application_id) ⇒ FusionAuth::ClientResponse
Revokes a single refresh token, all tokens for a user or all tokens for an application.
-
#revoke_user_consent(user_consent_id) ⇒ FusionAuth::ClientResponse
Revokes a single User consent by Id.
-
#search_audit_logs(request) ⇒ FusionAuth::ClientResponse
Searches the audit logs with the specified criteria and pagination.
-
#search_event_logs(request) ⇒ FusionAuth::ClientResponse
Searches the event logs with the specified criteria and pagination.
-
#search_login_records(request) ⇒ FusionAuth::ClientResponse
Searches the login records with the specified criteria and pagination.
-
#search_users(ids) ⇒ FusionAuth::ClientResponse
Retrieves the users for the given ids.
-
#search_users_by_query_string(request) ⇒ FusionAuth::ClientResponse
Retrieves the users for the given search criteria and pagination.
-
#send_email(email_template_id, request) ⇒ FusionAuth::ClientResponse
Send an email using an email template id.
-
#send_family_request_email(request) ⇒ FusionAuth::ClientResponse
Sends out an email to a parent that they need to register and create a family or need to log in and add a child to their existing family.
-
#send_passwordless_code(request) ⇒ FusionAuth::ClientResponse
Send a passwordless authentication code in an email to complete login.
-
#send_two_factor_code(request) ⇒ FusionAuth::ClientResponse
Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
-
#send_two_factor_code_for_login(two_factor_id) ⇒ FusionAuth::ClientResponse
Send a Two Factor authentication code to allow the completion of Two Factor authentication.
-
#two_factor_login(request) ⇒ FusionAuth::ClientResponse
Complete login using a 2FA challenge.
-
#update_application(application_id, request) ⇒ FusionAuth::ClientResponse
Updates the application with the given Id.
-
#update_application_role(application_id, role_id, request) ⇒ FusionAuth::ClientResponse
Updates the application role with the given id for the application.
-
#update_consent(consent_id, request) ⇒ FusionAuth::ClientResponse
Updates the consent with the given Id.
-
#update_email_template(email_template_id, request) ⇒ FusionAuth::ClientResponse
Updates the email template with the given Id.
-
#update_group(group_id, request) ⇒ FusionAuth::ClientResponse
Updates the group with the given Id.
-
#update_identity_provider(identity_provider_id, request) ⇒ FusionAuth::ClientResponse
Updates the identity provider with the given Id.
-
#update_integrations(request) ⇒ FusionAuth::ClientResponse
Updates the available integrations.
-
#update_key(key_id, request) ⇒ FusionAuth::ClientResponse
Updates the key with the given Id.
-
#update_lambda(lambda_id, request) ⇒ FusionAuth::ClientResponse
Updates the lambda with the given Id.
-
#update_registration(user_id, request) ⇒ FusionAuth::ClientResponse
Updates the registration for the user with the given id and the application defined in the request.
-
#update_system_configuration(request) ⇒ FusionAuth::ClientResponse
Updates the system configuration.
-
#update_tenant(tenant_id, request) ⇒ FusionAuth::ClientResponse
Updates the tenant with the given Id.
-
#update_theme(theme_id, request) ⇒ FusionAuth::ClientResponse
Updates the theme with the given Id.
-
#update_user(user_id, request) ⇒ FusionAuth::ClientResponse
Updates the user with the given Id.
-
#update_user_action(user_action_id, request) ⇒ FusionAuth::ClientResponse
Updates the user action with the given Id.
-
#update_user_action_reason(user_action_reason_id, request) ⇒ FusionAuth::ClientResponse
Updates the user action reason with the given Id.
-
#update_user_consent(user_consent_id, request) ⇒ FusionAuth::ClientResponse
Updates a single User consent by Id.
-
#update_webhook(webhook_id, request) ⇒ FusionAuth::ClientResponse
Updates the webhook with the given Id.
-
#validate_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse
Validates the provided JWT (encoded JWT string) to ensure the token is valid.
-
#verify_email(verification_id) ⇒ FusionAuth::ClientResponse
Confirms a email verification.
-
#verify_registration(verification_id) ⇒ FusionAuth::ClientResponse
Confirms an application registration.
Constructor Details
#initialize(api_key, base_url) ⇒ FusionAuthClient
Returns a new instance of FusionAuthClient.
32 33 34 35 36 37 |
# File 'lib/fusionauth/fusionauth_client.rb', line 32 def initialize(api_key, base_url) @api_key = api_key @base_url = base_url @connect_timeout = 1000 @read_timeout = 2000 end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
30 31 32 |
# File 'lib/fusionauth/fusionauth_client.rb', line 30 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
30 31 32 |
# File 'lib/fusionauth/fusionauth_client.rb', line 30 def base_url @base_url end |
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout.
30 31 32 |
# File 'lib/fusionauth/fusionauth_client.rb', line 30 def connect_timeout @connect_timeout end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
30 31 32 |
# File 'lib/fusionauth/fusionauth_client.rb', line 30 def read_timeout @read_timeout end |
Instance Method Details
#action_user(actionee_user_id, request) ⇒ FusionAuth::ClientResponse
Takes an action on a user. The user being actioned is called the “actionee” and the user taking the action is called the “actioner”. Both user ids are required. You pass the actionee’s user id into the method and the actioner’s is put into the request object.
49 50 51 52 53 54 55 |
# File 'lib/fusionauth/fusionauth_client.rb', line 49 def action_user(actionee_user_id, request) start.uri('/api/user/action') .url_segment(actionee_user_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#add_user_to_family(family_id, request) ⇒ FusionAuth::ClientResponse
Adds a user to an existing family. The family id must be specified.
64 65 66 67 68 69 70 |
# File 'lib/fusionauth/fusionauth_client.rb', line 64 def add_user_to_family(family_id, request) start.uri('/api/user/family') .url_segment(family_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#cancel_action(action_id, request) ⇒ FusionAuth::ClientResponse
Cancels the user action.
79 80 81 82 83 84 85 |
# File 'lib/fusionauth/fusionauth_client.rb', line 79 def cancel_action(action_id, request) start.uri('/api/user/action') .url_segment(action_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .delete() .go() end |
#change_password(change_password_id, request) ⇒ FusionAuth::ClientResponse
Changes a user’s password using the change password Id. This usually occurs after an email has been sent to the user and they clicked on a link to reset their password.
95 96 97 98 99 100 101 |
# File 'lib/fusionauth/fusionauth_client.rb', line 95 def change_password(change_password_id, request) start.uri('/api/user/change-password') .url_segment(change_password_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#change_password_by_identity(request) ⇒ FusionAuth::ClientResponse
Changes a user’s password using their identity (login id and password). Using a loginId instead of the changePasswordId bypasses the email verification and allows a password to be changed directly without first calling the #forgotPassword method.
111 112 113 114 115 116 |
# File 'lib/fusionauth/fusionauth_client.rb', line 111 def change_password_by_identity(request) start.uri('/api/user/change-password') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#comment_on_user(request) ⇒ FusionAuth::ClientResponse
Adds a comment to the user’s account.
124 125 126 127 128 129 |
# File 'lib/fusionauth/fusionauth_client.rb', line 124 def comment_on_user(request) start.uri('/api/user/comment') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_application(application_id, request) ⇒ FusionAuth::ClientResponse
Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
138 139 140 141 142 143 144 |
# File 'lib/fusionauth/fusionauth_client.rb', line 138 def create_application(application_id, request) start.uri('/api/application') .url_segment(application_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_application_role(application_id, role_id, request) ⇒ FusionAuth::ClientResponse
Creates a new role for an application. You must specify the id of the application you are creating the role for. You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.
155 156 157 158 159 160 161 162 163 |
# File 'lib/fusionauth/fusionauth_client.rb', line 155 def create_application_role(application_id, role_id, request) start.uri('/api/application') .url_segment(application_id) .url_segment("role") .url_segment(role_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_audit_log(request) ⇒ FusionAuth::ClientResponse
Creates an audit log with the message and user name (usually an email). Audit logs should be written anytime you make changes to the FusionAuth database. When using the FusionAuth App web interface, any changes are automatically written to the audit log. However, if you are accessing the API, you must write the audit logs yourself.
173 174 175 176 177 178 |
# File 'lib/fusionauth/fusionauth_client.rb', line 173 def create_audit_log(request) start.uri('/api/system/audit-log') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_consent(consent_id, request) ⇒ FusionAuth::ClientResponse
Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
187 188 189 190 191 192 193 |
# File 'lib/fusionauth/fusionauth_client.rb', line 187 def (, request) start.uri('/api/consent') .url_segment() .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_email_template(email_template_id, request) ⇒ FusionAuth::ClientResponse
Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
202 203 204 205 206 207 208 |
# File 'lib/fusionauth/fusionauth_client.rb', line 202 def create_email_template(email_template_id, request) start.uri('/api/email/template') .url_segment(email_template_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_family(family_id, request) ⇒ FusionAuth::ClientResponse
Creates a family with the user id in the request as the owner and sole member of the family. You can optionally specify an id for the family, if not provided one will be generated.
218 219 220 221 222 223 224 |
# File 'lib/fusionauth/fusionauth_client.rb', line 218 def create_family(family_id, request) start.uri('/api/user/family') .url_segment(family_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_group(group_id, request) ⇒ FusionAuth::ClientResponse
Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
233 234 235 236 237 238 239 |
# File 'lib/fusionauth/fusionauth_client.rb', line 233 def create_group(group_id, request) start.uri('/api/group') .url_segment(group_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_group_members(request) ⇒ FusionAuth::ClientResponse
Creates a member in a group.
247 248 249 250 251 252 |
# File 'lib/fusionauth/fusionauth_client.rb', line 247 def create_group_members(request) start.uri('/api/group/member') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_identity_provider(identity_provider_id, request) ⇒ FusionAuth::ClientResponse
Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
261 262 263 264 265 266 267 |
# File 'lib/fusionauth/fusionauth_client.rb', line 261 def create_identity_provider(identity_provider_id, request) start.uri('/api/identity-provider') .url_segment(identity_provider_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_lambda(lambda_id, request) ⇒ FusionAuth::ClientResponse
Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
276 277 278 279 280 281 282 |
# File 'lib/fusionauth/fusionauth_client.rb', line 276 def create_lambda(lambda_id, request) start.uri('/api/lambda') .url_segment(lambda_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_tenant(tenant_id, request) ⇒ FusionAuth::ClientResponse
Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
291 292 293 294 295 296 297 |
# File 'lib/fusionauth/fusionauth_client.rb', line 291 def create_tenant(tenant_id, request) start.uri('/api/tenant') .url_segment(tenant_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_theme(theme_id, request) ⇒ FusionAuth::ClientResponse
Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
306 307 308 309 310 311 312 |
# File 'lib/fusionauth/fusionauth_client.rb', line 306 def create_theme(theme_id, request) start.uri('/api/theme') .url_segment(theme_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_user(user_id, request) ⇒ FusionAuth::ClientResponse
Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
321 322 323 324 325 326 327 |
# File 'lib/fusionauth/fusionauth_client.rb', line 321 def create_user(user_id, request) start.uri('/api/user') .url_segment(user_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_user_action(user_action_id, request) ⇒ FusionAuth::ClientResponse
Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after that the user action can be applied to any user.
337 338 339 340 341 342 343 |
# File 'lib/fusionauth/fusionauth_client.rb', line 337 def create_user_action(user_action_id, request) start.uri('/api/user-action') .url_segment(user_action_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_user_action_reason(user_action_reason_id, request) ⇒ FusionAuth::ClientResponse
Creates a user reason. This user action reason cannot be used when actioning a user until this call completes successfully. Anytime after that the user action reason can be used.
353 354 355 356 357 358 359 |
# File 'lib/fusionauth/fusionauth_client.rb', line 353 def create_user_action_reason(user_action_reason_id, request) start.uri('/api/user-action-reason') .url_segment(user_action_reason_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_user_consent(user_consent_id, request) ⇒ FusionAuth::ClientResponse
Creates a single User consent.
368 369 370 371 372 373 374 |
# File 'lib/fusionauth/fusionauth_client.rb', line 368 def (, request) start.uri('/api/user/consent') .url_segment() .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#create_webhook(webhook_id, request) ⇒ FusionAuth::ClientResponse
Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
383 384 385 386 387 388 389 |
# File 'lib/fusionauth/fusionauth_client.rb', line 383 def create_webhook(webhook_id, request) start.uri('/api/webhook') .url_segment(webhook_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#deactivate_application(application_id) ⇒ FusionAuth::ClientResponse
Deactivates the application with the given Id.
397 398 399 400 401 402 |
# File 'lib/fusionauth/fusionauth_client.rb', line 397 def deactivate_application(application_id) start.uri('/api/application') .url_segment(application_id) .delete() .go() end |
#deactivate_user(user_id) ⇒ FusionAuth::ClientResponse
Deactivates the user with the given Id.
410 411 412 413 414 415 |
# File 'lib/fusionauth/fusionauth_client.rb', line 410 def deactivate_user(user_id) start.uri('/api/user') .url_segment(user_id) .delete() .go() end |
#deactivate_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Deactivates the user action with the given Id.
423 424 425 426 427 428 |
# File 'lib/fusionauth/fusionauth_client.rb', line 423 def deactivate_user_action(user_action_id) start.uri('/api/user-action') .url_segment(user_action_id) .delete() .go() end |
#deactivate_users(user_ids) ⇒ FusionAuth::ClientResponse
Deactivates the users with the given ids.
436 437 438 439 440 441 |
# File 'lib/fusionauth/fusionauth_client.rb', line 436 def deactivate_users(user_ids) start.uri('/api/user/bulk') .url_parameter('userId', user_ids) .delete() .go() end |
#delete_application(application_id) ⇒ FusionAuth::ClientResponse
Hard deletes an application. This is a dangerous operation and should not be used in most circumstances. This will delete the application, any registrations for that application, metrics and reports for the application, all the roles for the application, and any other data associated with the application. This operation could take a very long time, depending on the amount of data in your database.
452 453 454 455 456 457 458 |
# File 'lib/fusionauth/fusionauth_client.rb', line 452 def delete_application(application_id) start.uri('/api/application') .url_segment(application_id) .url_parameter('hardDelete', true) .delete() .go() end |
#delete_application_role(application_id, role_id) ⇒ FusionAuth::ClientResponse
Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This permanently removes the given role from all users that had it.
468 469 470 471 472 473 474 475 |
# File 'lib/fusionauth/fusionauth_client.rb', line 468 def delete_application_role(application_id, role_id) start.uri('/api/application') .url_segment(application_id) .url_segment("role") .url_segment(role_id) .delete() .go() end |
#delete_consent(consent_id) ⇒ FusionAuth::ClientResponse
Deletes the consent for the given Id.
483 484 485 486 487 488 |
# File 'lib/fusionauth/fusionauth_client.rb', line 483 def () start.uri('/api/consent') .url_segment() .delete() .go() end |
#delete_email_template(email_template_id) ⇒ FusionAuth::ClientResponse
Deletes the email template for the given Id.
496 497 498 499 500 501 |
# File 'lib/fusionauth/fusionauth_client.rb', line 496 def delete_email_template(email_template_id) start.uri('/api/email/template') .url_segment(email_template_id) .delete() .go() end |
#delete_group(group_id) ⇒ FusionAuth::ClientResponse
Deletes the group for the given Id.
509 510 511 512 513 514 |
# File 'lib/fusionauth/fusionauth_client.rb', line 509 def delete_group(group_id) start.uri('/api/group') .url_segment(group_id) .delete() .go() end |
#delete_group_members(request) ⇒ FusionAuth::ClientResponse
Removes users as members of a group.
522 523 524 525 526 527 |
# File 'lib/fusionauth/fusionauth_client.rb', line 522 def delete_group_members(request) start.uri('/api/group/member') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .delete() .go() end |
#delete_identity_provider(identity_provider_id) ⇒ FusionAuth::ClientResponse
Deletes the identity provider for the given Id.
535 536 537 538 539 540 |
# File 'lib/fusionauth/fusionauth_client.rb', line 535 def delete_identity_provider(identity_provider_id) start.uri('/api/identity-provider') .url_segment(identity_provider_id) .delete() .go() end |
#delete_key(key_od) ⇒ FusionAuth::ClientResponse
Deletes the key for the given Id.
548 549 550 551 552 553 |
# File 'lib/fusionauth/fusionauth_client.rb', line 548 def delete_key(key_od) start.uri('/api/key') .url_segment(key_od) .delete() .go() end |
#delete_lambda(lambda_id) ⇒ FusionAuth::ClientResponse
Deletes the lambda for the given Id.
561 562 563 564 565 566 |
# File 'lib/fusionauth/fusionauth_client.rb', line 561 def delete_lambda(lambda_id) start.uri('/api/lambda') .url_segment(lambda_id) .delete() .go() end |
#delete_registration(user_id, application_id) ⇒ FusionAuth::ClientResponse
Deletes the user registration for the given user and application.
575 576 577 578 579 580 581 |
# File 'lib/fusionauth/fusionauth_client.rb', line 575 def delete_registration(user_id, application_id) start.uri('/api/user/registration') .url_segment(user_id) .url_segment(application_id) .delete() .go() end |
#delete_tenant(tenant_id) ⇒ FusionAuth::ClientResponse
Deletes the tenant for the given Id.
589 590 591 592 593 594 |
# File 'lib/fusionauth/fusionauth_client.rb', line 589 def delete_tenant(tenant_id) start.uri('/api/tenant') .url_segment(tenant_id) .delete() .go() end |
#delete_theme(theme_id) ⇒ FusionAuth::ClientResponse
Deletes the theme for the given Id.
602 603 604 605 606 607 |
# File 'lib/fusionauth/fusionauth_client.rb', line 602 def delete_theme(theme_id) start.uri('/api/theme') .url_segment(theme_id) .delete() .go() end |
#delete_user(user_id) ⇒ FusionAuth::ClientResponse
Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated with the user.
616 617 618 619 620 621 622 |
# File 'lib/fusionauth/fusionauth_client.rb', line 616 def delete_user(user_id) start.uri('/api/user') .url_segment(user_id) .url_parameter('hardDelete', true) .delete() .go() end |
#delete_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Deletes the user action for the given Id. This permanently deletes the user action and also any history and logs of the action being applied to any users.
631 632 633 634 635 636 637 |
# File 'lib/fusionauth/fusionauth_client.rb', line 631 def delete_user_action(user_action_id) start.uri('/api/user-action') .url_segment(user_action_id) .url_parameter('hardDelete', true) .delete() .go() end |
#delete_user_action_reason(user_action_reason_id) ⇒ FusionAuth::ClientResponse
Deletes the user action reason for the given Id.
645 646 647 648 649 650 |
# File 'lib/fusionauth/fusionauth_client.rb', line 645 def delete_user_action_reason(user_action_reason_id) start.uri('/api/user-action-reason') .url_segment(user_action_reason_id) .delete() .go() end |
#delete_users(request) ⇒ FusionAuth::ClientResponse
Deletes the users with the given ids.
658 659 660 661 662 663 |
# File 'lib/fusionauth/fusionauth_client.rb', line 658 def delete_users(request) start.uri('/api/user/bulk') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .delete() .go() end |
#delete_webhook(webhook_id) ⇒ FusionAuth::ClientResponse
Deletes the webhook for the given Id.
671 672 673 674 675 676 |
# File 'lib/fusionauth/fusionauth_client.rb', line 671 def delete_webhook(webhook_id) start.uri('/api/webhook') .url_segment(webhook_id) .delete() .go() end |
#disable_two_factor(user_id, code) ⇒ FusionAuth::ClientResponse
Disable Two Factor authentication for a user.
685 686 687 688 689 690 691 |
# File 'lib/fusionauth/fusionauth_client.rb', line 685 def disable_two_factor(user_id, code) start.uri('/api/user/two-factor') .url_parameter('userId', user_id) .url_parameter('code', code) .delete() .go() end |
#enable_two_factor(user_id, request) ⇒ FusionAuth::ClientResponse
Enable Two Factor authentication for a user.
700 701 702 703 704 705 706 |
# File 'lib/fusionauth/fusionauth_client.rb', line 700 def enable_two_factor(user_id, request) start.uri('/api/user/two-factor') .url_segment(user_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#exchange_refresh_token_for_jwt(request) ⇒ FusionAuth::ClientResponse
Exchange a refresh token for a new JWT.
714 715 716 717 718 719 |
# File 'lib/fusionauth/fusionauth_client.rb', line 714 def exchange_refresh_token_for_jwt(request) start.uri('/api/jwt/refresh') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#forgot_password(request) ⇒ FusionAuth::ClientResponse
Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
727 728 729 730 731 732 |
# File 'lib/fusionauth/fusionauth_client.rb', line 727 def forgot_password(request) start.uri('/api/user/forgot-password') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#generate_email_verification_id(email) ⇒ FusionAuth::ClientResponse
Generate a new Email Verification Id to be used with the Verify Email API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system.
741 742 743 744 745 746 747 |
# File 'lib/fusionauth/fusionauth_client.rb', line 741 def generate_email_verification_id(email) start.uri('/api/user/verify-email') .url_parameter('email', email) .url_parameter('sendVerifyEmail', false) .put() .go() end |
#generate_key(key_id, request) ⇒ FusionAuth::ClientResponse
Generate a new RSA or EC key pair or an HMAC secret.
756 757 758 759 760 761 762 |
# File 'lib/fusionauth/fusionauth_client.rb', line 756 def generate_key(key_id, request) start.uri('/api/key/generate') .url_segment(key_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#generate_registration_verification_id(email, application_id) ⇒ FusionAuth::ClientResponse
Generate a new Application Registration Verification Id to be used with the Verify Registration API. This API will not attempt to send an email to the User. This API may be used to collect the verificationId for use with a third party system.
772 773 774 775 776 777 778 779 |
# File 'lib/fusionauth/fusionauth_client.rb', line 772 def generate_registration_verification_id(email, application_id) start.uri('/api/user/verify-registration') .url_parameter('email', email) .url_parameter('sendVerifyPasswordEmail', false) .url_parameter('applicationId', application_id) .put() .go() end |
#generate_two_factor_secret ⇒ FusionAuth::ClientResponse
Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication application such as Google Authenticator.
788 789 790 791 792 |
# File 'lib/fusionauth/fusionauth_client.rb', line 788 def generate_two_factor_secret() start.uri('/api/two-factor/secret') .get() .go() end |
#generate_two_factor_secret_using_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse
Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication application such as Google Authenticator.
802 803 804 805 806 807 |
# File 'lib/fusionauth/fusionauth_client.rb', line 802 def generate_two_factor_secret_using_jwt(encoded_jwt) start.uri('/api/two-factor/secret') .('JWT ' + encoded_jwt) .get() .go() end |
#identity_provider_login(request) ⇒ FusionAuth::ClientResponse
Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other login systems.
817 818 819 820 821 822 |
# File 'lib/fusionauth/fusionauth_client.rb', line 817 def identity_provider_login(request) start.uri('/api/identity-provider/login') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#import_key(key_id, request) ⇒ FusionAuth::ClientResponse
Import an existing RSA or EC key pair or an HMAC secret.
831 832 833 834 835 836 837 |
# File 'lib/fusionauth/fusionauth_client.rb', line 831 def import_key(key_id, request) start.uri('/api/key/import') .url_segment(key_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#import_users(request) ⇒ FusionAuth::ClientResponse
Bulk imports multiple users. This does some validation, but then tries to run batch inserts of users. This reduces latency when inserting lots of users. Therefore, the error response might contain some information about failures, but it will likely be pretty generic.
847 848 849 850 851 852 |
# File 'lib/fusionauth/fusionauth_client.rb', line 847 def import_users(request) start.uri('/api/user/import') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#issue_jwt(application_id, encoded_jwt) ⇒ FusionAuth::ClientResponse
Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid access token is properly signed and not expired. <p> This API may be used in an SSO configuration to issue new tokens for another application after the user has obtained a valid token from authentication.
865 866 867 868 869 870 871 |
# File 'lib/fusionauth/fusionauth_client.rb', line 865 def issue_jwt(application_id, encoded_jwt) start.uri('/api/jwt/issue') .('JWT ' + encoded_jwt) .url_parameter('applicationId', application_id) .get() .go() end |
#login(request) ⇒ FusionAuth::ClientResponse
Authenticates a user to FusionAuth.
This API optionally requires an API key. See Application.loginConfiguration.requireAuthentication
.
881 882 883 884 885 886 |
# File 'lib/fusionauth/fusionauth_client.rb', line 881 def login(request) start.uri('/api/login') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#login_ping(user_id, application_id, caller_ip_address) ⇒ FusionAuth::ClientResponse
Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using FusionAuth’s SSO or your own, you should call this if the user is already logged in centrally, but accesses an application where they no longer have a session. This helps correctly track login counts, times and helps with reporting.
900 901 902 903 904 905 906 907 |
# File 'lib/fusionauth/fusionauth_client.rb', line 900 def login_ping(user_id, application_id, caller_ip_address) start.uri('/api/login') .url_segment(user_id) .url_segment(application_id) .url_parameter('ipAddress', caller_ip_address) .put() .go() end |
#logout(global, refresh_token) ⇒ FusionAuth::ClientResponse
The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the client and revoke the refresh token stored. This API does nothing if the request does not contain an access token or refresh token cookies.
920 921 922 923 924 925 926 |
# File 'lib/fusionauth/fusionauth_client.rb', line 920 def logout(global, refresh_token) start.uri('/api/logout') .url_parameter('global', global) .url_parameter('refreshToken', refresh_token) .post() .go() end |
#lookup_identity_provider(domain) ⇒ FusionAuth::ClientResponse
Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed by a registered identity provider. A 404 indicates the domain is not managed.
935 936 937 938 939 940 |
# File 'lib/fusionauth/fusionauth_client.rb', line 935 def lookup_identity_provider(domain) start.uri('/api/identity-provider/lookup') .url_parameter('domain', domain) .get() .go() end |
#modify_action(action_id, request) ⇒ FusionAuth::ClientResponse
Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the action.
950 951 952 953 954 955 956 |
# File 'lib/fusionauth/fusionauth_client.rb', line 950 def modify_action(action_id, request) start.uri('/api/user/action') .url_segment(action_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#passwordless_login(request) ⇒ FusionAuth::ClientResponse
Complete a login request using a passwordless code
964 965 966 967 968 969 |
# File 'lib/fusionauth/fusionauth_client.rb', line 964 def passwordless_login(request) start.uri('/api/passwordless/login') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#reactivate_application(application_id) ⇒ FusionAuth::ClientResponse
Reactivates the application with the given Id.
977 978 979 980 981 982 983 |
# File 'lib/fusionauth/fusionauth_client.rb', line 977 def reactivate_application(application_id) start.uri('/api/application') .url_segment(application_id) .url_parameter('reactivate', true) .put() .go() end |
#reactivate_user(user_id) ⇒ FusionAuth::ClientResponse
Reactivates the user with the given Id.
991 992 993 994 995 996 997 |
# File 'lib/fusionauth/fusionauth_client.rb', line 991 def reactivate_user(user_id) start.uri('/api/user') .url_segment(user_id) .url_parameter('reactivate', true) .put() .go() end |
#reactivate_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Reactivates the user action with the given Id.
1005 1006 1007 1008 1009 1010 1011 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1005 def reactivate_user_action(user_action_id) start.uri('/api/user-action') .url_segment(user_action_id) .url_parameter('reactivate', true) .put() .go() end |
#reconcile_jwt(request) ⇒ FusionAuth::ClientResponse
Reconcile a User to FusionAuth using JWT issued from another Identity Provider.
1019 1020 1021 1022 1023 1024 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1019 def reconcile_jwt(request) start.uri('/api/jwt/reconcile') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#refresh_user_search_index ⇒ FusionAuth::ClientResponse
Request a refresh of the User search index. This API is not generally necessary and the search index will become consistent in a reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be if you are using the Search API or Delete Tenant API immediately following a User Create etc, you may wish to request a refresh to
ensure the index immediately current before making a query request to the search index.
1034 1035 1036 1037 1038 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1034 def refresh_user_search_index() start.uri('/api/user/search') .put() .go() end |
#register(user_id, request) ⇒ FusionAuth::ClientResponse
Registers a user for an application. If you provide the User and the UserRegistration object on this request, it will create the user as well as register them for the application. This is called a Full Registration. However, if you only provide the UserRegistration object, then the user must already exist and they will be registered for the application. The user id can also be provided and it will either be used to look up an existing user or it will be used for the newly created User.
1051 1052 1053 1054 1055 1056 1057 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1051 def register(user_id, request) start.uri('/api/user/registration') .url_segment(user_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#remove_user_from_family(family_id, user_id) ⇒ FusionAuth::ClientResponse
Removes a user from the family with the given id.
1066 1067 1068 1069 1070 1071 1072 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1066 def remove_user_from_family(family_id, user_id) start.uri('/api/user/family') .url_segment(family_id) .url_segment(user_id) .delete() .go() end |
#resend_email_verification(email) ⇒ FusionAuth::ClientResponse
Re-sends the verification email to the user.
1080 1081 1082 1083 1084 1085 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1080 def resend_email_verification(email) start.uri('/api/user/verify-email') .url_parameter('email', email) .put() .go() end |
#resend_registration_verification(email, application_id) ⇒ FusionAuth::ClientResponse
Re-sends the application registration verification email to the user.
1094 1095 1096 1097 1098 1099 1100 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1094 def resend_registration_verification(email, application_id) start.uri('/api/user/verify-registration') .url_parameter('email', email) .url_parameter('applicationId', application_id) .put() .go() end |
#retrieve_action(action_id) ⇒ FusionAuth::ClientResponse
Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.
1108 1109 1110 1111 1112 1113 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1108 def retrieve_action(action_id) start.uri('/api/user/action') .url_segment(action_id) .get() .go() end |
#retrieve_actions(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id. This will return all time based actions that are active, and inactive as well as non-time based actions.
1122 1123 1124 1125 1126 1127 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1122 def retrieve_actions(user_id) start.uri('/api/user/action') .url_parameter('userId', user_id) .get() .go() end |
#retrieve_actions_preventing_login(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id that are currently preventing the User from logging in.
1135 1136 1137 1138 1139 1140 1141 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1135 def retrieve_actions_preventing_login(user_id) start.uri('/api/user/action') .url_parameter('userId', user_id) .url_parameter('preventingLogin', true) .get() .go() end |
#retrieve_active_actions(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id that are currently active. An active action means one that is time based and has not been canceled, and has not ended.
1150 1151 1152 1153 1154 1155 1156 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1150 def retrieve_active_actions(user_id) start.uri('/api/user/action') .url_parameter('userId', user_id) .url_parameter('active', true) .get() .go() end |
#retrieve_application(application_id) ⇒ FusionAuth::ClientResponse
Retrieves the application for the given id or all of the applications if the id is null.
1164 1165 1166 1167 1168 1169 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1164 def retrieve_application(application_id) start.uri('/api/application') .url_segment(application_id) .get() .go() end |
#retrieve_applications ⇒ FusionAuth::ClientResponse
Retrieves all of the applications.
1176 1177 1178 1179 1180 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1176 def retrieve_applications() start.uri('/api/application') .get() .go() end |
#retrieve_audit_log(audit_log_id) ⇒ FusionAuth::ClientResponse
Retrieves a single audit log for the given Id.
1188 1189 1190 1191 1192 1193 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1188 def retrieve_audit_log(audit_log_id) start.uri('/api/system/audit-log') .url_segment(audit_log_id) .get() .go() end |
#retrieve_consent(consent_id) ⇒ FusionAuth::ClientResponse
Retrieves the Consent for the given Id.
1201 1202 1203 1204 1205 1206 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1201 def () start.uri('/api/consent') .url_segment() .get() .go() end |
#retrieve_consents ⇒ FusionAuth::ClientResponse
Retrieves all of the consent.
1213 1214 1215 1216 1217 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1213 def () start.uri('/api/consent') .get() .go() end |
#retrieve_daily_active_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the daily active user report between the two instants. If you specify an application id, it will only return the daily active counts for that application.
1228 1229 1230 1231 1232 1233 1234 1235 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1228 def retrieve_daily_active_report(application_id, start, _end) start.uri('/api/report/daily-active-user') .url_parameter('applicationId', application_id) .url_parameter('start', start) .url_parameter('end', _end) .get() .go() end |
#retrieve_email_template(email_template_id) ⇒ FusionAuth::ClientResponse
Retrieves the email template for the given Id. If you don’t specify the id, this will return all of the email templates.
1243 1244 1245 1246 1247 1248 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1243 def retrieve_email_template(email_template_id) start.uri('/api/email/template') .url_segment(email_template_id) .get() .go() end |
#retrieve_email_template_preview(request) ⇒ FusionAuth::ClientResponse
Creates a preview of the email template provided in the request. This allows you to preview an email template that hasn’t been saved to the database yet. The entire email template does not need to be provided on the request. This will create the preview based on whatever is given.
1258 1259 1260 1261 1262 1263 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1258 def retrieve_email_template_preview(request) start.uri('/api/email/template/preview') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#retrieve_email_templates ⇒ FusionAuth::ClientResponse
Retrieves all of the email templates.
1270 1271 1272 1273 1274 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1270 def retrieve_email_templates() start.uri('/api/email/template') .get() .go() end |
#retrieve_event_log(event_log_id) ⇒ FusionAuth::ClientResponse
Retrieves a single event log for the given Id.
1282 1283 1284 1285 1286 1287 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1282 def retrieve_event_log(event_log_id) start.uri('/api/system/event-log') .url_segment(event_log_id) .get() .go() end |
#retrieve_families(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the families that a user belongs to.
1295 1296 1297 1298 1299 1300 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1295 def retrieve_families(user_id) start.uri('/api/user/family') .url_parameter('userId', user_id) .get() .go() end |
#retrieve_family_members_by_family_id(family_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the members of a family by the unique Family Id.
1308 1309 1310 1311 1312 1313 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1308 def retrieve_family_members_by_family_id(family_id) start.uri('/api/user/family') .url_segment(family_id) .get() .go() end |
#retrieve_group(group_id) ⇒ FusionAuth::ClientResponse
Retrieves the group for the given Id.
1321 1322 1323 1324 1325 1326 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1321 def retrieve_group(group_id) start.uri('/api/group') .url_segment(group_id) .get() .go() end |
#retrieve_groups ⇒ FusionAuth::ClientResponse
Retrieves all of the groups.
1333 1334 1335 1336 1337 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1333 def retrieve_groups() start.uri('/api/group') .get() .go() end |
#retrieve_identity_provider(identity_provider_id) ⇒ FusionAuth::ClientResponse
Retrieves the identity provider for the given id or all of the identity providers if the id is null.
1345 1346 1347 1348 1349 1350 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1345 def retrieve_identity_provider(identity_provider_id) start.uri('/api/identity-provider') .url_segment(identity_provider_id) .get() .go() end |
#retrieve_identity_providers ⇒ FusionAuth::ClientResponse
Retrieves all of the identity providers.
1357 1358 1359 1360 1361 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1357 def retrieve_identity_providers() start.uri('/api/identity-provider') .get() .go() end |
#retrieve_inactive_actions(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the actions for the user with the given Id that are currently inactive. An inactive action means one that is time based and has been canceled or has expired, or is not time based.
1370 1371 1372 1373 1374 1375 1376 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1370 def retrieve_inactive_actions(user_id) start.uri('/api/user/action') .url_parameter('userId', user_id) .url_parameter('active', false) .get() .go() end |
#retrieve_inactive_applications ⇒ FusionAuth::ClientResponse
Retrieves all of the applications that are currently inactive.
1383 1384 1385 1386 1387 1388 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1383 def retrieve_inactive_applications() start.uri('/api/application') .url_parameter('inactive', true) .get() .go() end |
#retrieve_inactive_user_actions ⇒ FusionAuth::ClientResponse
Retrieves all of the user actions that are currently inactive.
1395 1396 1397 1398 1399 1400 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1395 def retrieve_inactive_user_actions() start.uri('/api/user-action') .url_parameter('inactive', true) .get() .go() end |
#retrieve_integration ⇒ FusionAuth::ClientResponse
Retrieves the available integrations.
1407 1408 1409 1410 1411 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1407 def retrieve_integration() start.uri('/api/integration') .get() .go() end |
#retrieve_jwt_public_key(key_id) ⇒ FusionAuth::ClientResponse
Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid).
1419 1420 1421 1422 1423 1424 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1419 def retrieve_jwt_public_key(key_id) start.uri('/api/jwt/public-key') .url_parameter('kid', key_id) .get() .go() end |
#retrieve_jwt_public_key_by_application_id(application_id) ⇒ FusionAuth::ClientResponse
Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id.
1432 1433 1434 1435 1436 1437 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1432 def retrieve_jwt_public_key_by_application_id(application_id) start.uri('/api/jwt/public-key') .url_parameter('applicationId', application_id) .get() .go() end |
#retrieve_jwt_public_keys ⇒ FusionAuth::ClientResponse
Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT).
1444 1445 1446 1447 1448 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1444 def retrieve_jwt_public_keys() start.uri('/api/jwt/public-key') .get() .go() end |
#retrieve_key(key_id) ⇒ FusionAuth::ClientResponse
Retrieves the key for the given Id.
1456 1457 1458 1459 1460 1461 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1456 def retrieve_key(key_id) start.uri('/api/key') .url_segment(key_id) .get() .go() end |
#retrieve_keys ⇒ FusionAuth::ClientResponse
Retrieves all of the keys.
1468 1469 1470 1471 1472 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1468 def retrieve_keys() start.uri('/api/key') .get() .go() end |
#retrieve_lambda(lambda_id) ⇒ FusionAuth::ClientResponse
Retrieves the lambda for the given Id.
1480 1481 1482 1483 1484 1485 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1480 def retrieve_lambda(lambda_id) start.uri('/api/lambda') .url_segment(lambda_id) .get() .go() end |
#retrieve_lambdas ⇒ FusionAuth::ClientResponse
Retrieves all of the lambdas.
1492 1493 1494 1495 1496 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1492 def retrieve_lambdas() start.uri('/api/lambda') .get() .go() end |
#retrieve_lambdas_by_type(type) ⇒ FusionAuth::ClientResponse
Retrieves all of the lambdas for the provided type.
1504 1505 1506 1507 1508 1509 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1504 def retrieve_lambdas_by_type(type) start.uri('/api/lambda') .url_parameter('type', type) .get() .go() end |
#retrieve_login_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the login report between the two instants. If you specify an application id, it will only return the login counts for that application.
1520 1521 1522 1523 1524 1525 1526 1527 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1520 def retrieve_login_report(application_id, start, _end) start.uri('/api/report/login') .url_parameter('applicationId', application_id) .url_parameter('start', start) .url_parameter('end', _end) .get() .go() end |
#retrieve_monthly_active_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the monthly active user report between the two instants. If you specify an application id, it will only return the monthly active counts for that application.
1538 1539 1540 1541 1542 1543 1544 1545 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1538 def retrieve_monthly_active_report(application_id, start, _end) start.uri('/api/report/monthly-active-user') .url_parameter('applicationId', application_id) .url_parameter('start', start) .url_parameter('end', _end) .get() .go() end |
#retrieve_oauth_configuration(application_id) ⇒ FusionAuth::ClientResponse
Retrieves the Oauth2 configuration for the application for the given Application Id.
1553 1554 1555 1556 1557 1558 1559 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1553 def retrieve_oauth_configuration(application_id) start.uri('/api/application') .url_segment(application_id) .url_segment("oauth-configuration") .get() .go() end |
#retrieve_password_validation_rules ⇒ FusionAuth::ClientResponse
Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id.
This API does not require an API key.
1569 1570 1571 1572 1573 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1569 def retrieve_password_validation_rules() start.uri('/api/tenant/password-validation-rules') .get() .go() end |
#retrieve_password_validation_rules_with_tenant_id(tenant_id) ⇒ FusionAuth::ClientResponse
Retrieves the password validation rules for a specific tenant.
This API does not require an API key.
1583 1584 1585 1586 1587 1588 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1583 def retrieve_password_validation_rules_with_tenant_id(tenant_id) start.uri('/api/tenant/password-validation-rules') .url_segment(tenant_id) .get() .go() end |
#retrieve_pending_children(parent_email) ⇒ FusionAuth::ClientResponse
Retrieves all of the children for the given parent email address.
1596 1597 1598 1599 1600 1601 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1596 def retrieve_pending_children(parent_email) start.uri('/api/user/family/pending') .url_parameter('parentEmail', parent_email) .get() .go() end |
#retrieve_recent_logins(offset, limit) ⇒ FusionAuth::ClientResponse
Retrieves the last number of login records.
1610 1611 1612 1613 1614 1615 1616 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1610 def retrieve_recent_logins(offset, limit) start.uri('/api/user/recent-login') .url_parameter('offset', offset) .url_parameter('limit', limit) .get() .go() end |
#retrieve_refresh_tokens(user_id) ⇒ FusionAuth::ClientResponse
Retrieves the refresh tokens that belong to the user with the given Id.
1624 1625 1626 1627 1628 1629 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1624 def retrieve_refresh_tokens(user_id) start.uri('/api/jwt/refresh') .url_parameter('userId', user_id) .get() .go() end |
#retrieve_registration(user_id, application_id) ⇒ FusionAuth::ClientResponse
Retrieves the user registration for the user with the given id and the given application id.
1638 1639 1640 1641 1642 1643 1644 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1638 def retrieve_registration(user_id, application_id) start.uri('/api/user/registration') .url_segment(user_id) .url_segment(application_id) .get() .go() end |
#retrieve_registration_report(application_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the registration report between the two instants. If you specify an application id, it will only return the registration counts for that application.
1655 1656 1657 1658 1659 1660 1661 1662 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1655 def retrieve_registration_report(application_id, start, _end) start.uri('/api/report/registration') .url_parameter('applicationId', application_id) .url_parameter('start', start) .url_parameter('end', _end) .get() .go() end |
#retrieve_system_configuration ⇒ FusionAuth::ClientResponse
Retrieves the system configuration.
1669 1670 1671 1672 1673 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1669 def retrieve_system_configuration() start.uri('/api/system-configuration') .get() .go() end |
#retrieve_tenant(tenant_id) ⇒ FusionAuth::ClientResponse
Retrieves the tenant for the given Id.
1681 1682 1683 1684 1685 1686 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1681 def retrieve_tenant(tenant_id) start.uri('/api/tenant') .url_segment(tenant_id) .get() .go() end |
#retrieve_tenants ⇒ FusionAuth::ClientResponse
Retrieves all of the tenants.
1693 1694 1695 1696 1697 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1693 def retrieve_tenants() start.uri('/api/tenant') .get() .go() end |
#retrieve_theme(theme_id) ⇒ FusionAuth::ClientResponse
Retrieves the theme for the given Id.
1705 1706 1707 1708 1709 1710 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1705 def retrieve_theme(theme_id) start.uri('/api/theme') .url_segment(theme_id) .get() .go() end |
#retrieve_themes ⇒ FusionAuth::ClientResponse
Retrieves all of the themes.
1717 1718 1719 1720 1721 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1717 def retrieve_themes() start.uri('/api/theme') .get() .go() end |
#retrieve_total_report ⇒ FusionAuth::ClientResponse
Retrieves the totals report. This contains all of the total counts for each application and the global registration count.
1729 1730 1731 1732 1733 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1729 def retrieve_total_report() start.uri('/api/report/totals') .get() .go() end |
#retrieve_user(user_id) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given Id.
1741 1742 1743 1744 1745 1746 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1741 def retrieve_user(user_id) start.uri('/api/user') .url_segment(user_id) .get() .go() end |
#retrieve_user_action(user_action_id) ⇒ FusionAuth::ClientResponse
Retrieves the user action for the given Id. If you pass in null for the id, this will return all of the user actions.
1755 1756 1757 1758 1759 1760 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1755 def retrieve_user_action(user_action_id) start.uri('/api/user-action') .url_segment(user_action_id) .get() .go() end |
#retrieve_user_action_reason(user_action_reason_id) ⇒ FusionAuth::ClientResponse
Retrieves the user action reason for the given Id. If you pass in null for the id, this will return all of the user action reasons.
1769 1770 1771 1772 1773 1774 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1769 def retrieve_user_action_reason(user_action_reason_id) start.uri('/api/user-action-reason') .url_segment(user_action_reason_id) .get() .go() end |
#retrieve_user_action_reasons ⇒ FusionAuth::ClientResponse
Retrieves all the user action reasons.
1781 1782 1783 1784 1785 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1781 def retrieve_user_action_reasons() start.uri('/api/user-action-reason') .get() .go() end |
#retrieve_user_actions ⇒ FusionAuth::ClientResponse
Retrieves all of the user actions.
1792 1793 1794 1795 1796 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1792 def retrieve_user_actions() start.uri('/api/user-action') .get() .go() end |
#retrieve_user_by_change_password_id(change_password_id) ⇒ FusionAuth::ClientResponse
Retrieves the user by a change password Id. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user’s email or username.
1805 1806 1807 1808 1809 1810 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1805 def retrieve_user_by_change_password_id(change_password_id) start.uri('/api/user') .url_parameter('changePasswordId', change_password_id) .get() .go() end |
#retrieve_user_by_email(email) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given email.
1818 1819 1820 1821 1822 1823 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1818 def retrieve_user_by_email(email) start.uri('/api/user') .url_parameter('email', email) .get() .go() end |
#retrieve_user_by_login_id(login_id) ⇒ FusionAuth::ClientResponse
Retrieves the user for the loginId. The loginId can be either the username or the email.
1831 1832 1833 1834 1835 1836 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1831 def retrieve_user_by_login_id(login_id) start.uri('/api/user') .url_parameter('loginId', login_id) .get() .go() end |
#retrieve_user_by_username(username) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given username.
1844 1845 1846 1847 1848 1849 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1844 def retrieve_user_by_username(username) start.uri('/api/user') .url_parameter('username', username) .get() .go() end |
#retrieve_user_by_verification_id(verification_id) ⇒ FusionAuth::ClientResponse
Retrieves the user by a verificationId. The intended use of this API is to retrieve a user after the forgot password workflow has been initiated and you may not know the user’s email or username.
1858 1859 1860 1861 1862 1863 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1858 def retrieve_user_by_verification_id(verification_id) start.uri('/api/user') .url_parameter('verificationId', verification_id) .get() .go() end |
#retrieve_user_comments(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the comments for the user with the given Id.
1871 1872 1873 1874 1875 1876 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1871 def retrieve_user_comments(user_id) start.uri('/api/user/comment') .url_segment(user_id) .get() .go() end |
#retrieve_user_consent(user_consent_id) ⇒ FusionAuth::ClientResponse
Retrieve a single User consent by Id.
1884 1885 1886 1887 1888 1889 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1884 def () start.uri('/api/user/consent') .url_segment() .get() .go() end |
#retrieve_user_consents(user_id) ⇒ FusionAuth::ClientResponse
Retrieves all of the consents for a User.
1897 1898 1899 1900 1901 1902 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1897 def (user_id) start.uri('/api/user/consent') .url_parameter('userId', user_id) .get() .go() end |
#retrieve_user_login_report(application_id, user_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the login report between the two instants for a particular user by Id. If you specify an application id, it will only return the login counts for that application.
1914 1915 1916 1917 1918 1919 1920 1921 1922 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1914 def retrieve_user_login_report(application_id, user_id, start, _end) start.uri('/api/report/login') .url_parameter('applicationId', application_id) .url_parameter('userId', user_id) .url_parameter('start', start) .url_parameter('end', _end) .get() .go() end |
#retrieve_user_login_report_by_login_id(application_id, login_id, start, _end) ⇒ FusionAuth::ClientResponse
Retrieves the login report between the two instants for a particular user by login Id. If you specify an application id, it will only return the login counts for that application.
1934 1935 1936 1937 1938 1939 1940 1941 1942 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1934 def retrieve_user_login_report_by_login_id(application_id, login_id, start, _end) start.uri('/api/report/login') .url_parameter('applicationId', application_id) .url_parameter('loginId', login_id) .url_parameter('start', start) .url_parameter('end', _end) .get() .go() end |
#retrieve_user_recent_logins(user_id, offset, limit) ⇒ FusionAuth::ClientResponse
Retrieves the last number of login records for a user.
1952 1953 1954 1955 1956 1957 1958 1959 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1952 def retrieve_user_recent_logins(user_id, offset, limit) start.uri('/api/user/recent-login') .url_parameter('userId', user_id) .url_parameter('offset', offset) .url_parameter('limit', limit) .get() .go() end |
#retrieve_user_using_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse
Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication.
1967 1968 1969 1970 1971 1972 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1967 def retrieve_user_using_jwt(encoded_jwt) start.uri('/api/user') .('JWT ' + encoded_jwt) .get() .go() end |
#retrieve_webhook(webhook_id) ⇒ FusionAuth::ClientResponse
Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
1980 1981 1982 1983 1984 1985 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1980 def retrieve_webhook(webhook_id) start.uri('/api/webhook') .url_segment(webhook_id) .get() .go() end |
#retrieve_webhooks ⇒ FusionAuth::ClientResponse
Retrieves all the webhooks.
1992 1993 1994 1995 1996 |
# File 'lib/fusionauth/fusionauth_client.rb', line 1992 def retrieve_webhooks() start.uri('/api/webhook') .get() .go() end |
#revoke_refresh_token(token, user_id, application_id) ⇒ FusionAuth::ClientResponse
Revokes a single refresh token, all tokens for a user or all tokens for an application. If you provide a user id and an application id, this will delete all the refresh tokens for that user for that application.
2007 2008 2009 2010 2011 2012 2013 2014 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2007 def revoke_refresh_token(token, user_id, application_id) start.uri('/api/jwt/refresh') .url_parameter('token', token) .url_parameter('userId', user_id) .url_parameter('applicationId', application_id) .delete() .go() end |
#revoke_user_consent(user_consent_id) ⇒ FusionAuth::ClientResponse
Revokes a single User consent by Id.
2022 2023 2024 2025 2026 2027 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2022 def () start.uri('/api/user/consent') .url_segment() .delete() .go() end |
#search_audit_logs(request) ⇒ FusionAuth::ClientResponse
Searches the audit logs with the specified criteria and pagination.
2035 2036 2037 2038 2039 2040 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2035 def search_audit_logs(request) start.uri('/api/system/audit-log/search') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#search_event_logs(request) ⇒ FusionAuth::ClientResponse
Searches the event logs with the specified criteria and pagination.
2048 2049 2050 2051 2052 2053 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2048 def search_event_logs(request) start.uri('/api/system/event-log/search') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#search_login_records(request) ⇒ FusionAuth::ClientResponse
Searches the login records with the specified criteria and pagination.
2061 2062 2063 2064 2065 2066 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2061 def search_login_records(request) start.uri('/api/system/login-record/search') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#search_users(ids) ⇒ FusionAuth::ClientResponse
Retrieves the users for the given ids. If any id is invalid, it is ignored.
2074 2075 2076 2077 2078 2079 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2074 def search_users(ids) start.uri('/api/user/search') .url_parameter('ids', ids) .get() .go() end |
#search_users_by_query_string(request) ⇒ FusionAuth::ClientResponse
Retrieves the users for the given search criteria and pagination.
2088 2089 2090 2091 2092 2093 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2088 def search_users_by_query_string(request) start.uri('/api/user/search') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#send_email(email_template_id, request) ⇒ FusionAuth::ClientResponse
Send an email using an email template id. You can optionally provide requestData
to access key value pairs in the email template.
2103 2104 2105 2106 2107 2108 2109 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2103 def send_email(email_template_id, request) start.uri('/api/email/send') .url_segment(email_template_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#send_family_request_email(request) ⇒ FusionAuth::ClientResponse
Sends out an email to a parent that they need to register and create a family or need to log in and add a child to their existing family.
2117 2118 2119 2120 2121 2122 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2117 def send_family_request_email(request) start.uri('/api/user/family/request') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#send_passwordless_code(request) ⇒ FusionAuth::ClientResponse
Send a passwordless authentication code in an email to complete login.
2130 2131 2132 2133 2134 2135 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2130 def send_passwordless_code(request) start.uri('/api/passwordless/send') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#send_two_factor_code(request) ⇒ FusionAuth::ClientResponse
Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
2143 2144 2145 2146 2147 2148 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2143 def send_two_factor_code(request) start.uri('/api/two-factor/send') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#send_two_factor_code_for_login(two_factor_id) ⇒ FusionAuth::ClientResponse
Send a Two Factor authentication code to allow the completion of Two Factor authentication.
2156 2157 2158 2159 2160 2161 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2156 def send_two_factor_code_for_login(two_factor_id) start.uri('/api/two-factor/send') .url_segment(two_factor_id) .post() .go() end |
#two_factor_login(request) ⇒ FusionAuth::ClientResponse
Complete login using a 2FA challenge
2169 2170 2171 2172 2173 2174 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2169 def two_factor_login(request) start.uri('/api/two-factor/login') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .post() .go() end |
#update_application(application_id, request) ⇒ FusionAuth::ClientResponse
Updates the application with the given Id.
2183 2184 2185 2186 2187 2188 2189 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2183 def update_application(application_id, request) start.uri('/api/application') .url_segment(application_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_application_role(application_id, role_id, request) ⇒ FusionAuth::ClientResponse
Updates the application role with the given id for the application.
2199 2200 2201 2202 2203 2204 2205 2206 2207 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2199 def update_application_role(application_id, role_id, request) start.uri('/api/application') .url_segment(application_id) .url_segment("role") .url_segment(role_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_consent(consent_id, request) ⇒ FusionAuth::ClientResponse
Updates the consent with the given Id.
2216 2217 2218 2219 2220 2221 2222 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2216 def (, request) start.uri('/api/consent') .url_segment() .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_email_template(email_template_id, request) ⇒ FusionAuth::ClientResponse
Updates the email template with the given Id.
2231 2232 2233 2234 2235 2236 2237 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2231 def update_email_template(email_template_id, request) start.uri('/api/email/template') .url_segment(email_template_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_group(group_id, request) ⇒ FusionAuth::ClientResponse
Updates the group with the given Id.
2246 2247 2248 2249 2250 2251 2252 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2246 def update_group(group_id, request) start.uri('/api/group') .url_segment(group_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_identity_provider(identity_provider_id, request) ⇒ FusionAuth::ClientResponse
Updates the identity provider with the given Id.
2261 2262 2263 2264 2265 2266 2267 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2261 def update_identity_provider(identity_provider_id, request) start.uri('/api/identity-provider') .url_segment(identity_provider_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_integrations(request) ⇒ FusionAuth::ClientResponse
Updates the available integrations.
2275 2276 2277 2278 2279 2280 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2275 def update_integrations(request) start.uri('/api/integration') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_key(key_id, request) ⇒ FusionAuth::ClientResponse
Updates the key with the given Id.
2289 2290 2291 2292 2293 2294 2295 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2289 def update_key(key_id, request) start.uri('/api/key') .url_segment(key_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_lambda(lambda_id, request) ⇒ FusionAuth::ClientResponse
Updates the lambda with the given Id.
2304 2305 2306 2307 2308 2309 2310 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2304 def update_lambda(lambda_id, request) start.uri('/api/lambda') .url_segment(lambda_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_registration(user_id, request) ⇒ FusionAuth::ClientResponse
Updates the registration for the user with the given id and the application defined in the request.
2319 2320 2321 2322 2323 2324 2325 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2319 def update_registration(user_id, request) start.uri('/api/user/registration') .url_segment(user_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_system_configuration(request) ⇒ FusionAuth::ClientResponse
Updates the system configuration.
2333 2334 2335 2336 2337 2338 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2333 def update_system_configuration(request) start.uri('/api/system-configuration') .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_tenant(tenant_id, request) ⇒ FusionAuth::ClientResponse
Updates the tenant with the given Id.
2347 2348 2349 2350 2351 2352 2353 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2347 def update_tenant(tenant_id, request) start.uri('/api/tenant') .url_segment(tenant_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_theme(theme_id, request) ⇒ FusionAuth::ClientResponse
Updates the theme with the given Id.
2362 2363 2364 2365 2366 2367 2368 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2362 def update_theme(theme_id, request) start.uri('/api/theme') .url_segment(theme_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_user(user_id, request) ⇒ FusionAuth::ClientResponse
Updates the user with the given Id.
2377 2378 2379 2380 2381 2382 2383 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2377 def update_user(user_id, request) start.uri('/api/user') .url_segment(user_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_user_action(user_action_id, request) ⇒ FusionAuth::ClientResponse
Updates the user action with the given Id.
2392 2393 2394 2395 2396 2397 2398 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2392 def update_user_action(user_action_id, request) start.uri('/api/user-action') .url_segment(user_action_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_user_action_reason(user_action_reason_id, request) ⇒ FusionAuth::ClientResponse
Updates the user action reason with the given Id.
2407 2408 2409 2410 2411 2412 2413 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2407 def update_user_action_reason(user_action_reason_id, request) start.uri('/api/user-action-reason') .url_segment(user_action_reason_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_user_consent(user_consent_id, request) ⇒ FusionAuth::ClientResponse
Updates a single User consent by Id.
2422 2423 2424 2425 2426 2427 2428 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2422 def (, request) start.uri('/api/user/consent') .url_segment() .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#update_webhook(webhook_id, request) ⇒ FusionAuth::ClientResponse
Updates the webhook with the given Id.
2437 2438 2439 2440 2441 2442 2443 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2437 def update_webhook(webhook_id, request) start.uri('/api/webhook') .url_segment(webhook_id) .body_handler(FusionAuth::JSONBodyHandler.new(request)) .put() .go() end |
#validate_jwt(encoded_jwt) ⇒ FusionAuth::ClientResponse
Validates the provided JWT (encoded JWT string) to ensure the token is valid. A valid access token is properly signed and not expired. <p> This API may be used to verify the JWT as well as decode the encoded JWT into human readable identity claims.
2454 2455 2456 2457 2458 2459 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2454 def validate_jwt(encoded_jwt) start.uri('/api/jwt/validate') .('JWT ' + encoded_jwt) .get() .go() end |
#verify_email(verification_id) ⇒ FusionAuth::ClientResponse
Confirms a email verification. The Id given is usually from an email sent to the user.
2467 2468 2469 2470 2471 2472 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2467 def verify_email(verification_id) start.uri('/api/user/verify-email') .url_segment(verification_id) .post() .go() end |
#verify_registration(verification_id) ⇒ FusionAuth::ClientResponse
Confirms an application registration. The Id given is usually from an email sent to the user.
2480 2481 2482 2483 2484 2485 |
# File 'lib/fusionauth/fusionauth_client.rb', line 2480 def verify_registration(verification_id) start.uri('/api/user/verify-registration') .url_segment(verification_id) .post() .go() end |