【发布时间】:2017-08-02 04:14:16
【问题描述】:
我正在使用 Angular 2 和锁定版本 10.8,并且我正在尝试为用户添加更改密码的功能。我试过下面的方法,调用Management API,其中参数user_id是从用户的Auth0配置文件接收到的user_id,参数connection是'Username-Password-Authentication'
public resetPassword(user_id: string, password: string, connection: string): Observable<any> {
let body = JSON.stringify({ password, connection });
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
return this.authHttp.patch('https://https://manage.auth0.com/api/v2/users/' + user_id, body, options).map(response => {
return response.json();
}).catch(this.appService.handleError);
}
使用此代码时,我收到以下错误:
选项 https://https//manage.auth0.com/api/v2/users/auth0%7C58b77f281667c9685d1019c3 网络::ERR_NAME_NOT_RESOLVED
我在这里做错了什么?
这是我使用的两个来源:
https://auth0.com/docs/connections/database/password-change
https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
是的,“更改密码流程 v2”切换已启用。
【问题讨论】: