SoftLayer API OpenIdConnect重置密码

问题描述:

您好:使用SoftLayer API REST,我有一个方法,在启动密码重置时工作正常。 (电子邮件发送给最终用户)但是,当我遇到使用新的OpenIdConnect的新用户设置时,我收到一个错误:{u'code':u'SoftLayer_Exception_Public', u'error':u'This用户是通过OpenIdConnect认证,并且必须使用OpenIdConnect提供商更改他们的密码。“}SoftLayer API OpenIdConnect重置密码

所以,我说的返回状态的检查和任何错误,这样在遇到当消息OpenIdConnect我使用新的方法SoftLayer_User_Customer_OpenIdConnect重新尝试/ initiatePortalPasswordChange。但是这不起作用。它返回一个具有相同错误信息的500。

我的方法的一个简单的例子是:

def set_user_password(self): 
    ''' This method initiates a portal password reset process.''' 


    myUser = { 
     "parameters" : [self.username] 
    } 


    restreq = self._url('SoftLayer_User_Customer/initiatePortalPasswordChange.json') 
    #print(restreq+"""',"""+' json=hwlist') 
    r = requests.post(restreq, json=myUser) 
    #pp(r) 
    #pp(r.json()) 
    result = r.json() 
    if 'SoftLayer_Exception_Public' in result['code']: 
     print("Exception found - checking error") 
    else: 
     print("Unknown error.") 
     return() 
    if 'OpenIdConnect' in result['error']: 
     print("OpenIdConnect error - this user is part of the new OpenID") 
     newrestreq = self._url('SoftLayer_User_Customer_OpenIdConnect/initiatePortalPasswordChange.json') 
     newr = requests.post(newrestreq, json=myUser) 
     pp(newr) 
     pp(newr.json()) 

的方法,上述发送第二POST请求但错误回具有相同的误差,因为如果不支持该方法的SoftLayer。下面,我运行它:

发现异常 - 错误检查 OpenIdConnect错误 - 该用户是新的OpenID {u'code的一部分 ':u'SoftLayer_Exception_Public', u'error':u'This '} 无

问题是因为您的用户创建的是blueId用户,所以这意味着您将无法使用更改密码来使用SoftLayer的API。您需要更改密码或使用bluemix api重置密码。

也通过UI:https://myibm.ibm.com/dashboard/(登录到IBMid后)

+0

唉..谢谢。我的印象是OpenIdConnect的方法可以通过SoftLayer API来实现。我在这里阅读另一个评论,关于这个迁移期间没有向后兼容性叹息..感谢您的回应。 –