Skip to content

Package: LogoutDefinition

LogoutDefinition

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 LogoutDefinition} annotation defines logout and RP session management
31: * configuration in openid connect client.
32: *
33: * <p>
34: * Expressions in attributes of type <code>String</code> are evaluated.
35: *
36: * @author jGauravGupta
37: */
38: @Retention(RUNTIME)
39: public @interface LogoutDefinition {
40:
41: /**
42: * Optional. Notify the OIDC provider (OP) that the user has logged out of
43: * the application and might want to log out of the OP as well. If true then
44: * after having logged out the user from RP, redirects the End-User's User
45: * Agent to the OP's logout endpoint URL. This URL is normally obtained via
46: * the end_session_endpoint element of the OP's metadata or can be
47: * customized via
48: * {@code OpenIdProviderMetadata#endSessionEndpoint}.
49: *
50: * @return true when OIDC provider is notified of logout.
51: */
52: boolean notifyProvider() default false;
53:
54: /**
55: * Optional. Allows the OIDC provider (OP) notification that the user has logged
56: * using the Jakarta Expression Language expression. If set, overrides the value set by notifyProvider.
57: */
58: String notifyProviderExpression() default "";
59:
60: /**
61: * Optional. The post logout redirect URI to which the RP is requesting that
62: * the End-User's User Agent be redirected after a logout has been
63: * performed. If redirect URI is empty then redirect to OpenID connect
64: * provider authorization_endpoint for re-authentication.
65: * *
66: *
67: * @return URL after logout is performed on the client.
68: */
69: String redirectURI() default "";
70:
71: /**
72: * Session timeout on the expiry of Access Token.
73: *
74: * @return
75: */
76: boolean accessTokenExpiry() default false;
77:
78: /**
79: * Allow the session timeout definition using a Jakarta Expression Language expression.
80: * If set, overrides the value defined with accessTokenExpiry.
81: *
82: * @return
83: */
84: String accessTokenExpiryExpression() default "";
85:
86: /**
87: * Session timeout on the expiry of Identity Token.
88: *
89: * @return
90: */
91: boolean identityTokenExpiry() default false;
92:
93: /**
94: * Allow the session timeout using the Jakarta Expression Language expression.
95: * If set, overrides the identityTokenExpiry value.
96: *
97: * @return
98: */
99: String identityTokenExpiryExpression() default "";
100:
101: }