Skip to content

Package: OpenIdProviderMetadata

OpenIdProviderMetadata

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: *
20: * Contributors:
21: * 2021 : Payara Foundation and/or its affiliates
22: * Initially authored in Security Connectors
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 OpenIdProviderMetadata} annotation overrides the openid connect
31: * provider's endpoint value, discovered using providerUri.
32: *
33: * <p>
34: * Expressions in attributes of type <code>String</code> are evaluated.
35: *
36: * @author Gaurav Gupta
37: * @author Rudy De Busscher
38: */
39: @Retention(RUNTIME)
40: public @interface OpenIdProviderMetadata {
41:
42: /**
43: * Required. The URL for the OAuth2 provider to provide authentication.
44: * This must be a https endpoint.
45: *
46: * @return URL for the OAuth2 provider.
47: */
48: String authorizationEndpoint() default "";
49:
50: /**
51: * Required. The URL for the OAuth2 provider to give the authorization token
52:
53: *
54: * @return URL for the OAuth2 provider.
55: */
56: String tokenEndpoint() default "";
57:
58: /**
59: * Optional. An OAuth 2.0 Protected Resource that returns Claims about the
60: * authenticated End-User.
61: *
62: * @return URL for User Info.
63: */
64: String userinfoEndpoint() default "";
65:
66: /**
67: * Optional. OP endpoint to notify that the End-User has logged out of the
68: * site and might want to log out of the OP as well.
69: *
70: * @return URL for logging out of server session.
71: */
72: String endSessionEndpoint() default "";
73:
74: /**
75: * Required. An OpenId Connect Provider's JSON Web Key Set document
76: * <p>
77: * This contains the signing key(s) the RP uses to validate signatures from
78: * the OP. The JWK Set may also contain the Server's encryption key(s),
79: * which are used by RPs to encrypt requests to the Server.
80: * </p>
81: *
82: * @return URL pointing to the JWK Set.
83: */
84: String jwksURI() default "";
85:
86:
87: /**
88: * Required. The issuer of the tokens issued by the Provider.
89: * @return
90: */
91: String issuer() default "";
92:
93:
94: /**
95: * Required. The supported subject Types by the Provider.
96: * @return
97: */
98: String subjectTypeSupported() default "public";
99:
100: /**
101: * Required. The supported Signing algorithms for the ID token by provider.
102: * @return
103: */
104: String idTokenSigningAlgorithmsSupported() default "RS256";
105:
106:
107: /**
108: * Required. The supported response types by the Provider.
109: * @return
110: */
111: String responseTypeSupported() default "code,id_token,token id_token";
112: }