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


Python Utils.deserialize方法代码示例

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


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

示例1: enroll_factor

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [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

示例2: test_user_applinks_deserialization

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def test_user_applinks_deserialization(self):
        json_str = '''
        [{
            "id": "auc9pp3udhKTBhNyS0h7",
            "label": "Application",
            "linkUrl": "https://example.okta.com/0oa9pp3udcBnjYs3E0h7/1234",
            "logoUrl": "https://example.okta.com/assets/img/logos/logo.png",
            "appName": "application",
            "appInstanceId": "0oa9pp3udcBnjYs3E0h7",
            "appAssignmentId": "0ua9pp3udgbxdDted0h7",
            "credentialsSetup": false,
            "hidden": false,
            "sortOrder": 0
          },
          {
            "id": "1od6bbdxlpb1BgDTi1h7",
            "label": "Another application",
            "linkUrl": "https://example.okta.com/0oa9pp3udcBnjYs3E0h7/5678",
            "logoUrl": "https://example.okta.com/assets/img/logos/logo.png",
            "appName": "another_application",
            "appInstanceId": "1od7bbdxnpb2BgDTi1h7",
            "appAssignmentId": "1od7bbdxnpb2BgDTi1h7",
            "credentialsSetup": true,
            "hidden": true,
            "sortOrder": 1
          }]
        '''

        result = Utils.deserialize(json_str, AppLinks)

        self.assertEqual(len(result), 2, "Cannot deserialize nested lists of objects")
        serialized = json.dumps(result, cls=Serializer)
        self.assertTrue("1od6bbdxlpb1BgDTi1h7" in serialized, "Nested lists aren't serialized properly")
开发者ID:okta,项目名称:oktasdk-python,代码行数:35,代码来源:SerializationTest.py

示例3: authenticate

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [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

示例4: verify_factor

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [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: auth_with_factor

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [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

示例6: extend_session

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def extend_session(self, id):
        """Extend a session's lifespan

        :param id: the target session id
        :rtype: Session
        """
        response = ApiClient.put_path(self, '/{0}'.format(id), None)
        return Utils.deserialize(response.text, Session)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:10,代码来源:SessionsClient.py

示例7: validate_session

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def validate_session(self, id):
        """Validate a session

        :param id: the target session id
        :rtype: Session
        """
        response = ApiClient.get_path(self, '/{0}'.format(id))
        return Utils.deserialize(response.text, Session)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:10,代码来源:SessionsClient.py

示例8: get_lifecycle_factors

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def get_lifecycle_factors(self, user_id):
        """Get enrolled factors for a user

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

示例9: get_factors_catalog

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def get_factors_catalog(self, user_id):
        """Get available factors for a user

        :param user_id: target user id
        :type user_id: str
        :rtype: list of FactorCatalogEntry
        """
        response = ApiClient.get_path(self, '/{0}/factors/catalog'.format(user_id))
        return Utils.deserialize(response.text, FactorCatalogEntry)
开发者ID:okta,项目名称:oktasdk-python,代码行数:11,代码来源:FactorsClient.py

示例10: get_app_instance

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def get_app_instance(self, id):
        """Get a single app

        :param id: the app id
        :type id: str
        :rtype: AppInstance
        """
        response = ApiClient.get_path(self, '/{0}'.format(id))
        return Utils.deserialize(response.text, AppInstance)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:11,代码来源:AppInstanceClient.py

示例11: create_app_instance

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [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

示例12: get_available_questions

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def get_available_questions(self, user_id):
        """Get available factor questions

        :param user_id: target user id
        :type user_id: str
        :rtype: list of Question
        """
        response = ApiClient.get_path(self, '/{0}/factors/questions'.format(user_id))
        return Utils.deserialize(response.text, Question)
开发者ID:okta,项目名称:oktasdk-python,代码行数:11,代码来源:FactorsClient.py

示例13: unlock_user

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [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

示例14: delete_group

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [as 别名]
    def delete_group(self, gid):
        """Delete group by target id

        :param gid: the target group id
        :type gid: str
        :return: None
        """
        response = ApiClient.delete_path(self, '/{0}'.format(gid))
        return Utils.deserialize(response.text, UserGroup)
开发者ID:MattParr,项目名称:oktasdk-python,代码行数:11,代码来源:UserGroupsClient.py

示例15: deactivate_org_factor

# 需要导入模块: from okta.framework.Utils import Utils [as 别名]
# 或者: from okta.framework.Utils.Utils import deserialize [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


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