# hide
import os
import nbdev
import domolibrary.classes.DomoUser as dmduSSO Routes
auth = dmda.DomoTokenAuth(
domo_instance=os.environ["DOMO_INSTANCE"],
domo_access_token=os.environ["DOMO_ACCESS_TOKEN"],
)
await auth.print_is_token()
full_auth = dmda.DomoFullAuth(
domo_instance=os.environ["DOMO_INSTANCE"],
domo_username=os.environ["DOMO_USERNAME"],
domo_password=os.environ["DOMO_PASSWORD"],
)🎉 token_auth token retrieved from domo-community ⚙️
Direct Signon
toggle_user_direct_signon_access
toggle_user_direct_signon_access (auth:domolibrary.client.DomoAuth.DomoA uth, user_id_ls:List[str], is_enable_direct_signon:bool=True, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class=None, debug_num_stacks_to_drop=1)
SSO_AddUserDirectSignonError
SSO_AddUserDirectSignonError (res:domolibrary.client.ResponseGetData.Res ponseGetData, user_id_ls:List[str], message=None)
base exception
domo_user = await dmdu.DomoUsers.by_email(
auth= auth,
email_ls= ['jae@datacrew.space']
)
await toggle_user_direct_signon_access(
auth = auth,
user_id_ls = [domo_user.id],
debug_api = False,
)ResponseGetData(status=200, response='successfully added 1893952720 to direct signon list in domo-community', is_success=True, parent_class=None)
SSO
SSO_CRUD_Error
SSO_CRUD_Error (res:domolibrary.client.ResponseGetData.ResponseGetData, message=None)
base exception
SSO_GET_Error
SSO_GET_Error (res:domolibrary.client.ResponseGetData.ResponseGetData, message=None)
base exception
OIDC
get_sso_oidc_config
get_sso_oidc_config (auth:domolibrary.client.DomoAuth.DomoAuth, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)
Open ID Connect framework
(await get_sso_oidc_config(auth=auth)).response{'loginEnabled': False,
'idpEnabled': False,
'importGroups': False,
'requireInvitation': False,
'enforceWhitelist': False,
'skipToIdp': False,
'authRequestEndpoint': '',
'tokenEndpoint': '',
'userInfoEndpoint': '',
'publicKey': '',
'redirectUrl': '',
'certificate': '',
'overrideSSO': False,
'overrideEmbed': False,
'wellKnownConfig': ''}
CRUD Operations
generate_sso_oidc_body
generate_sso_oidc_body (is_include_undefined:bool=False, login_enabled:bool=None, idp_enabled:bool=None, import_groups:bool=None, require_invitation:bool=None, enforce_allowlist:bool=None, skip_to_idp:bool=None, auth_request_endpoint:str=None, token_endpoint:str=None, user_info_endpoint:str=None, public_key:str=None, redirect_url:str=None, idp_certificate:str=None, override_sso:bool=None, override_embed:bool=None, well_known_config:str=None, assertion_endpoint:str=None, ingest_attributes:bool=None)
| Type | Default | Details | |
|---|---|---|---|
| is_include_undefined | bool | False | |
| login_enabled | bool | None | False |
| idp_enabled | bool | None | False |
| import_groups | bool | None | False |
| require_invitation | bool | None | False |
| enforce_allowlist | bool | None | False |
| skip_to_idp | bool | None | False |
| auth_request_endpoint | str | None | |
| token_endpoint | str | None | |
| user_info_endpoint | str | None | |
| public_key | str | None | |
| redirect_url | str | None | |
| idp_certificate | str | None | |
| override_sso | bool | None | False |
| override_embed | bool | None | False |
| well_known_config | str | None | “https://{domo_instance}}.domo.com/auth/oidc” |
| assertion_endpoint | str | None | |
| ingest_attributes | bool | None | False |
SSO_CRUD_Error
SSO_CRUD_Error (res:domolibrary.client.ResponseGetData.ResponseGetData, message=None)
base exception
update_sso_oidc_config
update_sso_oidc_config (auth:domolibrary.client.DomoAuth.DomoAuth, body_sso:dict, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)
to update saml config must update temp and then standard typically would hide under class functions, but b/c Domo won’t update w/o it, pushing down to Route
# import domolibrary.client.DomoAuth as dmda
res = await get_sso_oidc_config(auth=auth)
config_body = res.response
config_body.update(generate_sso_oidc_body(require_invitation=False))
# config_body = {'hello': 'failure'}
await update_sso_oidc_config(auth=auth, body_sso=config_body, debug_api=False)ResponseGetData(status=200, response='successfully disabled SSO', is_success=True, parent_class=None)
SAML
get_sso_saml_config
get_sso_saml_config (auth:domolibrary.client.DomoAuth.DomoAuth, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)
Security Assertion Markup Language
(await get_sso_saml_config(auth=auth)).response{'enabled': False,
'importGroups': False,
'requireInvitation': False,
'enforceWhitelist': False,
'redirectUrl': '',
'idpEnabled': 'false'}
get_sso_saml_certificate
get_sso_saml_certificate (auth:domolibrary.client.DomoAuth.DomoAuth, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)
(await get_sso_saml_certificate(auth = auth)).responseCRUD Operations
generate_sso_saml_body
generate_sso_saml_body (is_include_undefined:bool=False, is_enabled:bool=None, auth_request_endpoint:str=None, issuer:str=None, idp_certificate:str=None, import_groups:bool=None, require_invitation:bool=None, enforce_allowlist:bool=None, relay_state:bool=None, redirect_url:str=None, idp_enabled:bool=None, skip_to_idp:bool=None, login_enabled=None, token_endpoint=None, user_info_endpoint=None, public_key=None, override_sso=None, override_embed=None, well_known_config=None, assertion_endpoint=None, ingest_attributes=None, custom_attributes=None)
| Type | Default | Details | |
|---|---|---|---|
| is_include_undefined | bool | False | leave it as False to prevent overriding values you don’t want to update |
| is_enabled | bool | None | |
| auth_request_endpoint | str | None | url |
| issuer | str | None | url |
| idp_certificate | str | None | |
| import_groups | bool | None | |
| require_invitation | bool | None | |
| enforce_allowlist | bool | None | |
| relay_state | bool | None | |
| redirect_url | str | None | url |
| idp_enabled | bool | None | |
| skip_to_idp | bool | None | |
| login_enabled | NoneType | None | |
| token_endpoint | NoneType | None | |
| user_info_endpoint | NoneType | None | |
| public_key | NoneType | None | |
| override_sso | NoneType | None | |
| override_embed | NoneType | None | |
| well_known_config | NoneType | None | |
| assertion_endpoint | NoneType | None | |
| ingest_attributes | NoneType | None | |
| custom_attributes | NoneType | None |
body_sso = generate_sso_saml_body(
is_include_undefined = False,
is_enabled=True,
auth_request_endpoint = "",
issuer = "",
idp_certificate = "",
import_groups = False,
require_invitation = False,
enforce_allowlist =True,
relay_state = False,
redirect_url = "",
idp_enabled = True,
skip_to_idp = False,
custom_attributes = False
)
body_sso{'enabled': True,
'authRequestEndpoint': '',
'issuer': '',
'idpCertificate': '',
'importGroups': False,
'requireInvitation': False,
'enforceWhitelist': True,
'relayState': False,
'idpEnabled': True,
'skipToIdp': 'false',
'customAttributes': False,
'redirectUrl': ''}
update_sso_saml_config
update_sso_saml_config (auth:domolibrary.client.DomoAuth.DomoAuth, body_sso:dict, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)
to update saml config must update temp and then standard typically would hide under class functions, but b/c Domo won’t update w/o it, pushing down to Route
# import domolibrary.client.DomoAuth as dmda
res = await get_sso_saml_config(auth=auth)
config_body = res.response
config_body.update(generate_sso_saml_body(is_enabled=False))
# config_body = {'hello': 'failure'}
await update_sso_saml_config(auth=auth, body_sso=config_body, debug_api=False)ResponseGetData(status=200, response='successfully disabled SSO', is_success=True, parent_class=None)
set_sso_certificate
set_sso_certificate (auth:domolibrary.client.DomoAuth.DomoAuth, idp_certificate:str, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1, return_raw:bool=False)
toggle_sso_custom_attributes
toggle_sso_custom_attributes (auth:domolibrary.client.DomoAuth.DomoAuth, is_custom_attributes:bool, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)
unsure what this API does
toggle_sso_skip_to_idp
toggle_sso_skip_to_idp (auth:domolibrary.client.DomoAuth.DomoAuth, is_skip_to_idp:bool, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)