changePassword
Changes the password of the authenticated account
Requires a bearer token issued by this server.
/api/account/password
Usage and SDK Samples
curl -X POST \
-H "Authorization: Bearer [[accessToken]]" \
-H "Accept: application/problem+json" \
-H "Content-Type: application/json" \
"http://localhost:9000/api/account/password" \
-d '{
"currentPassword" : "currentPassword",
"newPassword" : "newPassword"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AccountApi;
import java.io.File;
import java.util.*;
public class AccountApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure Bearer (JWT) access token for authorization: bearer
HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer");
bearer.setBearerToken("BEARER TOKEN");
// Create an instance of the API class
AccountApi apiInstance = new AccountApi();
ChangePasswordRequest changePasswordRequest = ; // ChangePasswordRequest |
try {
apiInstance.changePassword(changePasswordRequest);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#changePassword");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final ChangePasswordRequest changePasswordRequest = new ChangePasswordRequest(); // ChangePasswordRequest |
try {
final result = await api_instance.changePassword(changePasswordRequest);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->changePassword: $e\n');
}
import org.openapitools.client.api.AccountApi;
public class AccountApiExample {
public static void main(String[] args) {
AccountApi apiInstance = new AccountApi();
ChangePasswordRequest changePasswordRequest = ; // ChangePasswordRequest |
try {
apiInstance.changePassword(changePasswordRequest);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#changePassword");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure Bearer (JWT) access token for authorization: bearer
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Create an instance of the API class
AccountApi *apiInstance = [[AccountApi alloc] init];
ChangePasswordRequest *changePasswordRequest = ; //
// Changes the password of the authenticated account
[apiInstance changePasswordWith:changePasswordRequest
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var IruruetaAuthServerApi = require('irurueta_auth_server_api');
var defaultClient = IruruetaAuthServerApi.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.accessToken = "YOUR ACCESS TOKEN";
// Create an instance of the API class
var api = new IruruetaAuthServerApi.AccountApi()
var changePasswordRequest = ; // {ChangePasswordRequest}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.changePassword(changePasswordRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class changePasswordExample
{
public void main()
{
// Configure Bearer (JWT) access token for authorization: bearer
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Create an instance of the API class
var apiInstance = new AccountApi();
var changePasswordRequest = new ChangePasswordRequest(); // ChangePasswordRequest |
try {
// Changes the password of the authenticated account
apiInstance.changePassword(changePasswordRequest);
} catch (Exception e) {
Debug.Print("Exception when calling AccountApi.changePassword: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) access token for authorization: bearer
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AccountApi();
$changePasswordRequest = ; // ChangePasswordRequest |
try {
$api_instance->changePassword($changePasswordRequest);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->changePassword: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AccountApi;
# Configure Bearer (JWT) access token for authorization: bearer
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AccountApi->new();
my $changePasswordRequest = WWW::OPenAPIClient::Object::ChangePasswordRequest->new(); # ChangePasswordRequest |
eval {
$api_instance->changePassword(changePasswordRequest => $changePasswordRequest);
};
if ($@) {
warn "Exception when calling AccountApi->changePassword: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure Bearer (JWT) access token for authorization: bearer
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Create an instance of the API class
api_instance = openapi_client.AccountApi()
changePasswordRequest = # ChangePasswordRequest |
try:
# Changes the password of the authenticated account
api_instance.change_password(changePasswordRequest)
except ApiException as e:
print("Exception when calling AccountApi->changePassword: %s\n" % e)
extern crate AccountApi;
pub fn main() {
let changePasswordRequest = ; // ChangePasswordRequest
let mut context = AccountApi::Context::default();
let result = client.changePassword(changePasswordRequest, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| changePasswordRequest * |
Responses
| Name | Type | Format | Description |
|---|---|---|---|
| WWW-Authenticate | String |