Skip to content

Package: RegistrationProcessor

RegistrationProcessor

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Red Hat Inc 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: * Red Hat Inc - initial API and implementation
12: * Eurotech
13: *******************************************************************************/
14: package org.eclipse.kapua.security.registration;
15:
16: import org.eclipse.kapua.service.user.User;
17: import org.jose4j.jwt.consumer.JwtContext;
18:
19: import java.util.Optional;
20:
21: /**
22: * A registration processor
23: *
24: * <p>
25: * A registration process may be able to create a new user based on the provided
26: * OpenID SSO authentication context.
27: * </p>
28: */
29: public interface RegistrationProcessor extends AutoCloseable {
30:
31: /**
32: * Ask the registration process to create a new user
33: *
34: * @param context the context to use as reference
35: * @return an optional new user, never returns {@code null}, but may return {@link Optional#empty()}
36: * @throws Exception if anything goes wrong
37: */
38: Optional<User> createUser(JwtContext context) throws Exception;
39: }