Skip to content

Package: ClaimsDefinition

ClaimsDefinition

Coverage

1: /*
2: * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: *
16: */
17:
18: /*
19: * Contributors:
20: * 2021 : Payara Foundation and/or its affiliates
21: * Initially authored in Security Connectors
22: */
23:
24: package jakarta.security.enterprise.authentication.mechanism.http.openid;
25:
26: import java.lang.annotation.Retention;
27: import static java.lang.annotation.RetentionPolicy.RUNTIME;
28:
29: /**
30: * {@link ClaimsDefinition} annotation defines claims mapping in openid connect
31: * client configuration. Expression Language
32: *
33: * <p>
34: * Expressions in attributes of type <code>String</code> are evaluated.
35: *
36: * @author jGauravGupta
37: * @author Rudy De Busscher
38: */
39: @Retention(RUNTIME)
40: public @interface ClaimsDefinition {
41:
42:
43: /**
44: * Maps the callerNameClaim's value to caller name value in
45: * jakarta.security.enterprise.identitystore.IdentityStore#validate
46: *
47: *
48: * @return Claim name to be used as caller.
49: */
50: String callerNameClaim() default OpenIdConstant.PREFERRED_USERNAME;
51:
52: /**
53: * Maps the callerGroupsClaim's value to caller groups value in
54: * jakarta.security.enterprise.identitystore.IdentityStore#validate
55: *
56: *
57: * @return Claim name to be used as caller Group.
58: */
59: String callerGroupsClaim() default OpenIdConstant.GROUPS;
60:
61: }