Skip to content

Package: OpenIdConstant

OpenIdConstant

nameinstructionbranchcomplexitylinemethod
static {...}
M: 40 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%

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.util.List;
27:
28: import static java.util.Arrays.asList;
29: import static java.util.Collections.unmodifiableList;
30:
31: /**
32: * Contains constant specific to OpenId Connect specification
33: * http://openid.net/specs/openid-connect-core-1_0.html
34: *
35: * @author Gaurav Gupta
36: */
37: public interface OpenIdConstant {
38:
39: // Authorization Code request/response parameters
40: String RESPONSE_TYPE = "response_type";
41: String CLIENT_ID = "client_id";
42: String SCOPE = "scope";
43: String REDIRECT_URI = "redirect_uri";
44: String RESPONSE_MODE = "response_mode";
45: String STATE = "state";
46: String NONCE = "nonce";
47: String DISPLAY = "display";
48: String PROMPT = "prompt";
49: String MAX_AGE = "max_age";
50: String UI_LOCALES = "ui_locales";
51: String CLAIMS_LOCALES = "claims_locales";
52: String ID_TOKEN_HINT = "id_token_hint";
53: String LOGIN_HINT = "login_hint";
54: String ACR_VALUES = "acr_values";
55: String CODE = "code";
56: String POST_LOGOUT_REDIRECT_URI = "post_logout_redirect_uri";
57:
58: // Access Token request/response parameters
59: String GRANT_TYPE = "grant_type";
60: String AUTHORIZATION_CODE = "authorization_code";
61: String CLIENT_SECRET = "client_secret";
62: String ACCESS_TOKEN = "access_token";
63: String IDENTITY_TOKEN = "id_token";
64: String TOKEN_TYPE = "token_type";
65: String EXPIRES_IN = "expires_in";
66: String REFRESH_TOKEN = "refresh_token";
67: String ERROR_PARAM = "error";
68: String ERROR_DESCRIPTION_PARAM = "error_description";
69:
70: //claims
71: String ISSUER_IDENTIFIER = "iss";
72: String SUBJECT_IDENTIFIER = "sub";
73: String EXPIRATION_IDENTIFIER = "exp";
74: String AUDIENCE = "aud";
75: String AUTHORIZED_PARTY = "azp";
76: String ACCESS_TOKEN_HASH = "at_hash";
77:
78: // OpenID Provider Metadata
79: String AUTHORIZATION_ENDPOINT = "authorization_endpoint";
80: String TOKEN_ENDPOINT = "token_endpoint";
81: String USERINFO_ENDPOINT = "userinfo_endpoint";
82: String END_SESSION_ENDPOINT = "end_session_endpoint";
83: String REGISTRATION_ENDPOINT = "registration_endpoint";
84: String JWKS_URI = "jwks_uri";
85:
86: String ISSUER = "issuer";
87: String SCOPES_SUPPORTED = "scopes_supported";
88: String ID_TOKEN_SIGNING_ALG_VALUES_SUPPORTED = "id_token_signing_alg_values_supported";
89: String RESPONSE_TYPES_SUPPORTED = "response_types_supported";
90: String RESPONSE_MODES_SUPPORTED = "response_modes_supported";
91: String TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED = "token_endpoint_auth_methods_supported";
92: String TOKEN_ENDPOINT_AUTH_SIGNING_ALG_VALUES_SUPPORTED = "token_endpoint_auth_signing_alg_values_supported";
93: String DISPLAY_VALUES_SUPPORTED = "display_values_supported";
94: String CLAIMS_SUPPORTED = "claims_supported";
95: String CLAIM_TYPES_SUPPORTED = "claim_types_supported";
96: String SUBJECT_TYPES_SUPPORTED = "subject_types_supported";
97:
98: List<String> AUTHORIZATION_CODE_FLOW_TYPES
99: = unmodifiableList(asList(
100: "code"
101: ));
102: List<String> IMPLICIT_FLOW_TYPES
103: = unmodifiableList(asList(
104: "id_token",
105: "id_token token"
106: ));
107: List<String> HYBRID_FLOW_TYPES
108: = unmodifiableList(asList(
109: "code id_token",
110: "code token",
111: "code id_token token"
112: ));
113:
114: // Scopes
115: String OPENID_SCOPE = "openid"; //required
116: String PROFILE_SCOPE = "profile";
117: String EMAIL_SCOPE = "email";
118: String PHONE_SCOPE = "phone";
119: String OFFLINE_ACCESS_SCOPE = "offline_access";
120:
121: // profile scope claims
122: String NAME = "name";
123: String FAMILY_NAME = "family_name";
124: String GIVEN_NAME = "given_name";
125: String MIDDLE_NAME = "middle_name";
126: String NICKNAME = "nickname";
127: String PREFERRED_USERNAME = "preferred_username";
128: String GROUPS = "groups";
129: String PROFILE = "profile";
130: String PICTURE = "picture";
131: String WEBSITE = "website";
132: String GENDER = "gender";
133: String BIRTHDATE = "birthdate";
134: String ZONEINFO = "zoneinfo";
135: String LOCALE = "locale";
136: String UPDATED_AT = "updated_at";
137:
138: // email scope claims
139: String EMAIL = "email";
140: String EMAIL_VERIFIED = "email_verified";
141:
142: // address scope claims
143: String ADDRESS = "address";
144:
145: // phone scope claims
146: String PHONE_NUMBER = "phone_number";
147: String PHONE_NUMBER_VERIFIED = "phone_number_verified";
148:
149: String DEFAULT_JWT_SIGNED_ALGORITHM = "RS256";
150: String DEFAULT_HASH_ALGORITHM = "SHA-256";
151:
152: // Original user Request
153: String ORIGINAL_REQUEST = "oidc.original.request";
154:
155: }