SoftLayer API OpenIdConnect重置密码 [英] SoftLayer API OpenIdConnect Reset Password

查看:34
本文介绍了SoftLayer API OpenIdConnect重置密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好:使用SoftLayer API REST,我有一种方法可以在初始化密码重置时正常工作. (电子邮件已发送给最终用户)但是,当我遇到使用新的OpenIdConnect的较新的用户设置时,会收到错误消息:{u'code':u'SoftLayer_Exception_Public', u'error':u'此用户已通过OpenIdConnect身份验证,必须使用OpenIdConnect提供程序来更改其密码.'}

Hello: Using the SoftLayer API REST, I have a method that works fine when initiating a password reset. (email is sent to end user) However, when I encounter a newer user setup that uses the new OpenIdConnect, I receive an error: {u'code': u'SoftLayer_Exception_Public', u'error': u'This user is authenticated by OpenIdConnect and must use the OpenIdConnect provider to change their password.'}

因此,我添加了对返回状态和任何错误的检查,以便在遇到消息OpenIdConnect时,可以使用新方法SoftLayer_User_Customer_OpenIdConnect/initiatePortalPasswordChange重试.但是,这不起作用.它返回500,带有相同的错误消息.

So, I added a check on the return status and any error so that when the message OpenIdConnect is encountered I re-try using the new method SoftLayer_User_Customer_OpenIdConnect/initiatePortalPasswordChange. This however is not working. It returns a 500 with the same error message.

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

A simple example of my method is:

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方法一样.在下面,我正在运行它:

The method above sends the second POST request but errors back with the same error, as if this SoftLayer method isn't supported. Below, I am running it:

发现异常-检查错误 OpenIdConnect错误-该用户是新OpenID的一部分 {u'code':u'SoftLayer_Exception_Public', u'error':u'此用户已通过OpenIdConnect进行身份验证,必须使用OpenIdConnect提供程序来更改其密码.'} 没有

Exception found - checking error OpenIdConnect error - this user is part of the new OpenID {u'code': u'SoftLayer_Exception_Public', u'error': u'This user is authenticated by OpenIdConnect and must use the OpenIdConnect provider to change their password.'} None

推荐答案

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

The issue is because your user created is a blueId user, so it means that you will not be able to change your password using SoftLayer's API. You need to change the password or reset the password using a bluemix api.

也通过用户界面: https://myibm.ibm.com/dashboard/(后登录到IBMid)

Also through UI: https://myibm.ibm.com/dashboard/ (after logging into IBMid)

这篇关于SoftLayer API OpenIdConnect重置密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆