Skip to content

Package: UserCredentialsService

UserCredentialsService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2023, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.authentication.user;
14:
15: import org.eclipse.kapua.KapuaException;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.service.KapuaService;
18: import org.eclipse.kapua.service.authentication.credential.Credential;
19:
20: /**
21: * Credential service definition.
22: *
23: * @since 2.0.0
24: */
25: public interface UserCredentialsService extends KapuaService {
26:
27: /**
28: * Change the password of the authenticated user, according to the given {@link PasswordChangeRequest}
29: *
30: * @param passwordChangeRequest request for change the password
31: * @return The updated credential
32: * @throws KapuaException
33: */
34: Credential changePassword(PasswordChangeRequest passwordChangeRequest) throws KapuaException;
35:
36:
37: /**
38: * Reset the password of a user, according to the given {@link PasswordResetRequest}
39: *
40: * @param scopeId scope of the {@link Credential} in which to change the password
41: * @param credentialId id of the {@link Credential} to change the password
42: * @param passwordResetRequest request for resetting password
43: * @return The updated credential
44: */
45: Credential resetPassword(KapuaId scopeId, KapuaId credentialId, PasswordResetRequest passwordResetRequest) throws KapuaException;
46: }