oktaawscli/aws_auth.py
def choose_aws_role(self, assertion, refresh_role):
        """ Choose AWS role from SAML assertion """

        roles = self.__extract_available_roles_from(assertion)
        if self.role:
            predefined_role = self.__find_predefined_role_from(roles)
            if predefined_role and not refresh_role:
                self.logger.info("Using predefined role: %s" % self.role)
                return predefined_role
            elif refresh_role:
                self.logger.info("""Refreshing role""")
            else:
                self.logger.info("""Predefined role, %s, not found in the list
of roles assigned to you.""" % self.role)

        self.logger.info("Please choose a role.")
        role_options = self.__create_options_from(roles, assertion, self.lookup)
        for option in role_options:
            print(option)

        role_choice = int(input('Please select the AWS role: ')) - 1
        return roles[role_choice]
 Choose AWS role from SAML assertion 
Choose AWS role from SAML assertion
Choose AWS role from SAML assertion
def choose_aws_role(self, assertion, refresh_role):
        roles = self.__extract_available_roles_from(assertion)
        if self.role:
            predefined_role = self.__find_predefined_role_from(roles)
            if predefined_role and not refresh_role:
                self.logger.info("Using predefined role: %s" % self.role)
                return predefined_role
            elif refresh_role:
                self.logger.info("""Refreshing role""")
            else:
                self.logger.info("""Predefined role, %s, not found in the list
of roles assigned to you.""" % self.role)
        self.logger.info("Please choose a role.")
        role_options = self.__create_options_from(roles, assertion, self.lookup)
        for option in role_options:
            print(option)
        role_choice = int(input('Please select the AWS role: ')) - 1
        return roles[role_choice]
def choose_aws_role ( self , assertion , refresh_role ) : roles = self . __extract_available_roles_from ( assertion ) if self . role : predefined_role = self . __find_predefined_role_from ( roles ) if predefined_role and not refresh_role : self . logger . info ( "Using predefined role: %s" % self . role ) return predefined_role elif refresh_role : self . logger . info ( """Refreshing role""" ) else : self . logger . info ( """Predefined role, %s, not found in the list
of roles assigned to you.""" % self . role ) self . logger . info ( "Please choose a role." ) role_options = self . __create_options_from ( roles , assertion , self . lookup ) for option in role_options : print ( option ) role_choice = int ( input ( 'Please select the AWS role: ' ) ) - 1 return roles [ role_choice ]
Choose AWS role from SAML assertion
Choose AWS role from SAML assertion
""" Choose AWS role from SAML assertion """
self
assertion
refresh_role