当前位置: 首页>>代码示例>>Python>>正文


Python ApiClient.post_path方法代码示例

本文整理汇总了Python中okta.framework.ApiClient.ApiClient.post_path方法的典型用法代码示例。如果您正苦于以下问题:Python ApiClient.post_path方法的具体用法?Python ApiClient.post_path怎么用?Python ApiClient.post_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在okta.framework.ApiClient.ApiClient的用法示例。


在下文中一共展示了ApiClient.post_path方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: deactivate_app_instance

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def deactivate_app_instance(self, id):
        """Deactivate app by target id

        :param id: the target app id
        :type id: str
        :return: None
        """
        ApiClient.post_path(self, '/{0}/lifecycle/deactivate'.format(id), None)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:10,代码来源:AppInstanceClient.py

示例2: authenticate

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def authenticate(self, username, password,
                     relay_state=None, response_type=None, force_mfa=None, context=None):
        """Begin the authentication process with a username and password

        :param username: user's username
        :type username: str
        :param password: user's password
        :type password: str
        :param relay_state: data that will persist for the lifetime of the authentication or recovery token
        :type relay_state: str or None
        :param response_type: the type of session to return (session_token or session_token_url usually)
        :type response_type: str
        :param force_mfa: whether to force mfa even if the auth is exempt
        :type force_mfa: bool
        :param context: contextual info about the auth request like ip and location
        :type context: Context
        :rtype: AuthResult
        """
        request = {
            'username': username,
            'password': password,
            'relayState': relay_state,
            'context': context
        }

        params = {
            'force_mfa': force_mfa,
            'response_type': response_type
        }

        response = ApiClient.post_path(self, '/', request, params=params)
        return Utils.deserialize(response.text, AuthResult)
开发者ID:okta,项目名称:oktasdk-python,代码行数:34,代码来源:AuthClient.py

示例3: auth_with_factor

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def auth_with_factor(self, state_token, factor_id, passcode,
                         relay_state=None, remember_device=None):
        """Continue authentication with an MFA attempt

        :param state_token: current state token from the previous AuthResult
        :type state_token: str
        :param factor_id: target factor id
        :type factor_id: str
        :param passcode: passcode required for authenticating the factor
        :type passcode: str
        :param relay_state: data that will persist for the lifetime of the authentication or recovery token
        :type relay_state: str or None
        :param remember_device: whether to remember this device to avoid requiring MFA next time
        :type remember_device: bool
        :rtype: AuthResult
        """
        request = {
            'stateToken': state_token,
            'passCode': passcode,
            'relayState': relay_state
        }

        params = {
            'rememberDevice': remember_device
        }

        response = ApiClient.post_path(self, '/factors/{0}/verify'.format(factor_id),
                                      request, params=params)
        return Utils.deserialize(response.text, AuthResult)
开发者ID:okta,项目名称:oktasdk-python,代码行数:31,代码来源:AuthClient.py

示例4: verify_factor

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def verify_factor(self, user_id, user_factor_id, activation_token=None, answer=None, passcode=None, next_passcode=None):
        """Verify an enrolled factor

        :param user_id: target user id
        :type user_id: str
        :param user_factor_id: target factor id
        :type user_factor_id: str
        :param activation_token: token required for activation
        :type activation_token: str
        :param answer: answer usually required for a question factor
        :type answer: str
        :param passcode: code required for verification
        :type passcode: str
        :param next_passcode: code usually required for TOTP
        :type next_passcode: str
        :return:
        """
        request = {
            'activationToken': activation_token,
            'answer': answer,
            'passCode': passcode,
            'nextPassCode': next_passcode
        }
        response = ApiClient.post_path(self, '/{0}/factors/{1}/verify'.format(user_id, user_factor_id), request)
        return Utils.deserialize(response.text, FactorVerificationResponse)
开发者ID:okta,项目名称:oktasdk-python,代码行数:27,代码来源:FactorsClient.py

示例5: enroll_factor

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def enroll_factor(self, state_token, factor_type, provider, profile, relay_state=None):
        """Enroll in an MFA factor during the auth flow. Usually only encountered if MFA is required for authentication

        :param state_token: current state token from the previous AuthResult
        :type state_token: str
        :param factor_type: type of factor (sms, token, question, token:software:totp, token:hardware etc)
        :type factor_type: str
        :param provider: factor provider (OKTA, RSA, SYMANTEC, GOOGLE etc)
        :type provider: str
        :param profile: factor profile that depends on the factor type
        :type profile: FactorProfile
        :param relay_state: data that will persist for the lifetime of the authentication or recovery token
        :type relay_state: str or None
        :rtype: AuthResult
        """
        request = {
            'stateToken': state_token,
            'factorType': factor_type,
            'provider': provider,
            'profile': profile,
            'relayState': relay_state
        }

        response = ApiClient.post_path(self, '/factors', request)
        return Utils.deserialize(response.text, AuthResult)
开发者ID:okta,项目名称:oktasdk-python,代码行数:27,代码来源:AuthClient.py

示例6: create_user

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def create_user(self, user, activate=None):
        """Create a user

        :param user: the data to create a user
        :type user: User
        :param activate: whether to activate the user
        :type activate: bool
        :rtype: User
        """
        if activate is None:
            response = ApiClient.post_path(self, '/', user)
        else:
            params = {
                'activate': activate
            }
            response = ApiClient.post_path(self, '/', user, params=params)
        return Utils.deserialize(response.text, User)
开发者ID:okta,项目名称:oktasdk-python,代码行数:19,代码来源:UsersClient.py

示例7: expire_password

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def expire_password(self, uid, temp_password=False):
        """Expire user's password by target user id

        :param uid: the target user id
        :type uid: str
        :param temp_password: whether a temporary password should be set
        :type temp_password: bool
        :return: None or TempPassword
        """
        if not temp_password:
            response = ApiClient.post_path(self, '/{0}/lifecycle/expire_password'.format(uid))
        else:
            params = {
                'tempPassword': temp_password
            }
            response = ApiClient.post_path(self, '/{0}/lifecycle/expire_password'.format(uid), params=params)
        return Utils.deserialize(response.text, TempPassword)
开发者ID:okta,项目名称:oktasdk-python,代码行数:19,代码来源:UsersClient.py

示例8: reset_factors

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def reset_factors(self, uid):
        """Reset all user factors by target id

        :param uid: the target user id
        :type uid: str
        :return: None
        """
        response = ApiClient.post_path(self, '/{0}/lifecycle/reset_factors'.format(uid))
        return Utils.deserialize(response.text, User)
开发者ID:okta,项目名称:oktasdk-python,代码行数:11,代码来源:UsersClient.py

示例9: unlock_user

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def unlock_user(self, uid):
        """Unlock user by target id

        :param uid: the target user id
        :type uid: str
        :return: User
        """
        response = ApiClient.post_path(self, '/{0}/lifecycle/unlock'.format(uid))
        return Utils.deserialize(response.text, User)
开发者ID:okta,项目名称:oktasdk-python,代码行数:11,代码来源:UsersClient.py

示例10: deactivate_user

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def deactivate_user(self, uid):
        """Deactivate user by target id

        :param uid: the target user id
        :type uid: str
        :return: User
        """
        response = ApiClient.post_path(self, '/{0}/lifecycle/deactivate'.format(uid))
        return Utils.deserialize(response.text, User)
开发者ID:okta,项目名称:oktasdk-python,代码行数:11,代码来源:UsersClient.py

示例11: deactivate_org_factor

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def deactivate_org_factor(self, org_factor_id):
        """Deactivate OrgAuthFactor

        :param org_factor_id: target factor id
        :type org_factor_id: str
        :rtype: OrgAuthFactor
        """
        response = ApiClient.post_path(self, '/factors/{0}/lifecycle/deactivate'.format(org_factor_id))
        return Utils.deserialize(response.text, OrgAuthFactor)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:11,代码来源:FactorsAdminClient.py

示例12: create_app_instance

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def create_app_instance(self, app_instance):
        """Create a app instance

        :param app_instance: the data to create a user
        :type app_instance: AppInstance
        :rtype: AppInstance
        """
        response = ApiClient.post_path(self, '/', app_instance)
        return Utils.deserialize(response.text, AppInstance)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:11,代码来源:AppInstanceClient.py

示例13: create_group

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def create_group(self, group):
        """Create a group

        :param group: the data to create a group
        :type group: UserGroup
        :rtype: UserGroup
        """
        response = ApiClient.post_path(self, '/', group)
        return Utils.deserialize(response.text, UserGroup)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:11,代码来源:UserGroupsClient.py

示例14: enroll_factor_device

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def enroll_factor_device(self, user_id, factor_enroll_request):
        """Enroll a factor device for a user

        :param user_id: target user id
        :type user_id: str
        :param factor_enroll_request: data to enroll the factor device
        :type factor_enroll_request: FactorEnrollRequest
        :rtype: FactorDevice
        """
        response = ApiClient.post_path(self, '/{0}/devices'.format(user_id), factor_enroll_request)
        return Utils.deserialize(response.text, FactorDevice)
开发者ID:okta,项目名称:oktasdk-python,代码行数:13,代码来源:FactorsClient.py

示例15: resend_code

# 需要导入模块: from okta.framework.ApiClient import ApiClient [as 别名]
# 或者: from okta.framework.ApiClient.ApiClient import post_path [as 别名]
    def resend_code(self, user_id, user_factor_id):
        """Resend code for a factor

        :param user_id: target user id
        :type user_id: str
        :param user_factor_id: target factor id
        :type user_factor_id: str
        :return:
        """
        response = ApiClient.post_path(self, '/{0}/factors/{1}/resend'.format(user_id, user_factor_id))
        return Utils.deserialize(response.text, Factor)
开发者ID:okta,项目名称:oktasdk-python,代码行数:13,代码来源:FactorsClient.py


注:本文中的okta.framework.ApiClient.ApiClient.post_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。