| Title: | Interact with the 'OneLogin' API |
|---|---|
| Description: | The identity provider ['OneLogin']<http://onelogin.com> is used for authentication via Single Sign On (SSO). This package provides an R interface to their API. |
| Authors: | Alex Gold [aut, cre], Cole Arendt [ctb] |
| Maintainer: | Alex Gold <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.1 |
| Built: | 2026-05-28 09:46:03 UTC |
| Source: | https://github.com/alexkgold/onelogin |
Generate Invite Link
ol_invite_gen_link(con, email)ol_invite_gen_link(con, email)
con |
a 'OneLogin' connection |
email |
email of a user |
data frame with email and invite link
if(interactive()) ol_invite_gen_link(onelogin(), "[email protected]")if(interactive()) ol_invite_gen_link(onelogin(), "[email protected]")
Send Invite Links
ol_invite_send_link(con, email)ol_invite_send_link(con, email)
con |
a 'OneLogin' connection |
email |
email of a user |
if (interactive()) ol_invite_send_link(onelogin(), "[email protected]")if (interactive()) ol_invite_send_link(onelogin(), "[email protected]")
Get details of particular role
ol_role_get_by_id(con, role_id)ol_role_get_by_id(con, role_id)
con |
a 'OneLogin' connection |
role_id |
the id of a role |
a tibble of details on the role
if (interactive()) ol_role_get_by_id(onelogin(), 1234)if (interactive()) ol_role_get_by_id(onelogin(), 1234)
Get all available roles
ol_roles_get(con, ...)ol_roles_get(con, ...)
con |
a 'OneLogin' connection |
... |
filters for the roles. See options in the API docs. |
a tibble of roles
if (interactive()) ol_roles_get(onelogin())if (interactive()) ol_roles_get(onelogin())
Generate a 'OneLogin' token
ol_token_get(con)ol_token_get(con)
con |
a 'OneLogin' connection |
A 'OneLogin' connection with auth token
if(interactive()) ol_token_get(onelogin())if(interactive()) ol_token_get(onelogin())
Get 'OneLogin' API rate limit
ol_token_get_rate_limit(con)ol_token_get_rate_limit(con)
con |
a 'OneLogin' connection |
A tibble of rate limit data
if(interactive()) ol_token_get_rate_limit(onelogin())if(interactive()) ol_token_get_rate_limit(onelogin())
Refresh 'OneLogin' auth token
ol_token_refresh(con)ol_token_refresh(con)
con |
a 'OneLogin' connection |
A 'OneLogin' connection with refreshed auth token
if(interactive()) ol_token_refresh(onelogin())if(interactive()) ol_token_refresh(onelogin())
OneLogin access tokenRevoke OneLogin access token
ol_token_revoke(con)ol_token_revoke(con)
con |
a 'OneLogin' connection |
A tibble of response status
#' if(interactive()) ol_token_revoke(onelogin())#' if(interactive()) ol_token_revoke(onelogin())
Assign role to user
ol_user_assign_role(con, user_id, role_id_array)ol_user_assign_role(con, user_id, role_id_array)
con |
a 'OneLogin' connection |
user_id |
user id |
role_id_array |
numeric, one or more roles |
if (interactive()) ol_user_assign_role(onelogin(), 54963040, 268986)if (interactive()) ol_user_assign_role(onelogin(), 54963040, 268986)
For a full listing of available fields, see the API documentation
ol_user_create(con, firstname, lastname, email, username, ...)ol_user_create(con, firstname, lastname, email, username, ...)
con |
a 'OneLogin' connection |
firstname |
first name, character |
lastname |
last name, character |
email |
full email, character |
username |
username |
... |
other named parameters for the person |
A tibble of user data
if (interactive()) ol_user_create(onelogin(), "Fake", "User", "[email protected]", "fake")if (interactive()) ol_user_create(onelogin(), "Fake", "User", "[email protected]", "fake")
Delete user
ol_user_delete(con, user_id)ol_user_delete(con, user_id)
con |
a 'OneLogin' connection |
user_id |
user id |
if (interactive()) ol_user_delete(onelogin(), 54963040)if (interactive()) ol_user_delete(onelogin(), 54963040)
Get Apps for User
ol_user_get_apps(con, user_id)ol_user_get_apps(con, user_id)
con |
a 'OneLogin' connection |
user_id |
user id |
A tibble of user data (one row)
if (interactive()) ol_user_get_apps(onelogin(), 54400533)if (interactive()) ol_user_get_apps(onelogin(), 54400533)
Get a User by their ID
ol_user_get_by_id(con, user_id)ol_user_get_by_id(con, user_id)
con |
a 'OneLogin' connection |
user_id |
user id |
A tibble of user data (one row)
if (interactive()) ol_user_get_by_id(onelogin(), 54400533)if (interactive()) ol_user_get_by_id(onelogin(), 54400533)
Get custom fields available for users
ol_user_get_custom_fields(con)ol_user_get_custom_fields(con)
con |
a 'OneLogin' connection |
A tibble of custom fields available
if (interactive()) ol_user_get_custom_fields(onelogin())if (interactive()) ol_user_get_custom_fields(onelogin())
Get Roles for a User
ol_user_get_roles(con, user_id)ol_user_get_roles(con, user_id)
con |
a 'OneLogin' connection |
user_id |
user id |
A data frame of the user id and role
if (interactive()) ol_user_get_roles(onelogin(), 54400533)if (interactive()) ol_user_get_roles(onelogin(), 54400533)
Lock user
ol_user_lock_account(con, user_id, locked_until = 0)ol_user_lock_account(con, user_id, locked_until = 0)
con |
a 'OneLogin' connection |
user_id |
user id |
locked_until |
numeric, number of minutes, default to 0 see API documentation for more details |
if (interactive()) ol_user_lock_account(onelogin(), 54963040)if (interactive()) ol_user_lock_account(onelogin(), 54963040)
Log user out
ol_user_log_out(con, user_id)ol_user_log_out(con, user_id)
con |
a 'OneLogin' connection |
user_id |
user id |
if (interactive()) ol_user_log_out(onelogin(), 54963040)if (interactive()) ol_user_log_out(onelogin(), 54963040)
Set or change user's password
ol_user_pwd_cleartext(con, user_id, password, password_confirmation, validate_policy = FALSE)ol_user_pwd_cleartext(con, user_id, password, password_confirmation, validate_policy = FALSE)
con |
a 'OneLogin' connection |
user_id |
user id |
password |
character, new password |
password_confirmation |
character, new password |
validate_policy |
utilize password policy checks? defaults to FALSE |
if (interactive()) ol_user_pwd_cleartext(onelogin(), 54963040, "pwd", "pwd")if (interactive()) ol_user_pwd_cleartext(onelogin(), 54963040, "pwd", "pwd")
See the API docs for details on how to encrypt the password.
ol_user_pwd_sha256_salt(con, user_id, password, password_confirmation, password_algorithm = "salt+sha256", password_salt = "")ol_user_pwd_sha256_salt(con, user_id, password, password_confirmation, password_algorithm = "salt+sha256", password_salt = "")
con |
a 'OneLogin' connection |
user_id |
user id |
password |
character, new password |
password_confirmation |
character, new password |
password_algorithm |
algorithm, defaults to "salt+sha256" |
password_salt |
defaults to "" |
if (interactive()) ol_user_pwd_sha256_salt(onelogin(), 54963040, safer::encrypt_string("saltpwd"), safer::encrypt_string("saltpwd"), password_salt = "salt")if (interactive()) ol_user_pwd_sha256_salt(onelogin(), 54963040, safer::encrypt_string("saltpwd"), safer::encrypt_string("saltpwd"), password_salt = "salt")
Remove role from user
ol_user_remove_role(con, user_id, role_id_array)ol_user_remove_role(con, user_id, role_id_array)
con |
a 'OneLogin' connection |
user_id |
user id |
role_id_array |
numeric, one or more roles |
if (interactive()) ol_user_remove_role(onelogin(), 54963040, 268986)if (interactive()) ol_user_remove_role(onelogin(), 54963040, 268986)
See ol_user_get_custom_fields to get custom fields
ol_user_set_custom_attr(con, user_id, ...)ol_user_set_custom_attr(con, user_id, ...)
con |
a 'OneLogin' connection |
user_id |
user id |
... |
named custom attributes to set |
if (interactive()) ol_user_set_custom_attr(onelogin, 54963040, attr = "value")if (interactive()) ol_user_set_custom_attr(onelogin, 54963040, attr = "value")
Set user state
ol_user_set_state(con, user_id, state)ol_user_set_state(con, user_id, state)
con |
a 'OneLogin' connection |
user_id |
user id |
state |
numeric, 0-3, see documentation for value meanings |
if (interactive()) ol_user_set_state(onelogin(), 54963040, 1)if (interactive()) ol_user_set_state(onelogin(), 54963040, 1)
Update user information by ID
ol_user_update(con, user_id, ...)ol_user_update(con, user_id, ...)
con |
a 'OneLogin' connection |
user_id |
user id |
... |
named parameters to change in request |
A tibble of user data
if (interactive()) ol_user_update(onelogin(), 54963040, firstname = "Fake1")if (interactive()) ol_user_update(onelogin(), 54963040, firstname = "Fake1")
You can filter the user by various parameters in onelogin. See the page in the API docs for filter options.
ol_users_get(con, ...)ol_users_get(con, ...)
con |
a 'OneLogin' connection |
... |
filter parameters, optional; see API documentation |
The id column in the returned tibble is the user_id for any of the user functions that are by id.
A tibble of users and their attributes
if (interactive()) ol_users_get(onelogin()) if (interactive()) ol_users_get(onelogin(), firstname = "name")if (interactive()) ol_users_get(onelogin()) if (interactive()) ol_users_get(onelogin(), firstname = "name")
Define a connection to the 'OneLogin' API. Please see the API documentation for details on using this API and on getting credentials.
onelogin(region = "US", client_id = Sys.getenv("ONELOGIN_CLIENT_ID"), client_secret = Sys.getenv("ONELOGIN_CLIENT_SECRET"))onelogin(region = "US", client_id = Sys.getenv("ONELOGIN_CLIENT_ID"), client_secret = Sys.getenv("ONELOGIN_CLIENT_SECRET"))
region |
either "US" or "EU", defaults to "US" |
client_id |
'OneLogin' client ID, defaults to Sys.getenv("ONELOGIN_CLIENT_ID") |
client_secret |
'OneLogin' client secret, defaults to Sys.getenv("ONELOGIN_CLIENT_SECRET") |
A 'OneLogin' connection
if (interactive()) onelogin(region = "US")if (interactive()) onelogin(region = "US")