-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jetty 9.4.x 3456 programmatic authentication (#3472)
* Issue #3456 Allow multiple programmatic login/logout in same request. Signed-off-by: Jan Bartel <janb@webtide.com>
- jetty-12.1.0.alpha1
- jetty-12.1.0.alpha0
- jetty-12.0.16
- jetty-12.0.15
- jetty-12.0.14
- jetty-12.0.13
- jetty-12.0.12
- jetty-12.0.11
- jetty-12.0.10
- jetty-12.0.9
- jetty-12.0.8
- jetty-12.0.7
- jetty-12.0.6
- jetty-12.0.5
- jetty-12.0.4
- jetty-12.0.3
- jetty-12.0.2
- jetty-12.0.1
- jetty-12.0.0
- jetty-12.0.0x
- jetty-12.0.0.beta4
- jetty-12.0.0.beta3
- jetty-12.0.0.beta3x
- jetty-12.0.0.beta2
- jetty-12.0.0.beta2x
- jetty-12.0.0.beta1
- jetty-12.0.0.beta0
- jetty-12.0.0.alpha3
- jetty-12.0.0.alpha2
- jetty-12.0.0.alpha1
- jetty-12.0.0.alpha0
- jetty-11.0.24
- jetty-11.0.23
- jetty-11.0.22
- jetty-11.0.21
- jetty-11.0.20
- jetty-11.0.19
- jetty-11.0.18
- jetty-11.0.17
- jetty-11.0.16
- jetty-11.0.15
- jetty-11.0.14
- jetty-11.0.13
- jetty-11.0.12
- jetty-11.0.11
- jetty-11.0.10
- jetty-11.0.9
- jetty-11.0.8
- jetty-11.0.7
- jetty-11.0.6
- jetty-11.0.5
- jetty-11.0.4
- jetty-11.0.3
- jetty-11.0.2
- jetty-11.0.1
- jetty-11.0.0
- jetty-11.0.0.beta3
- jetty-11.0.0.beta2
- jetty-11.0.0.beta1
- jetty-11.0.0-alpha0
- jetty-10.0.24
- jetty-10.0.23
- jetty-10.0.22
- jetty-10.0.21
- jetty-10.0.20
- jetty-10.0.19
- jetty-10.0.18
- jetty-10.0.17
- jetty-10.0.16
- jetty-10.0.15
- jetty-10.0.14
- jetty-10.0.13
- jetty-10.0.12
- jetty-10.0.11
- jetty-10.0.10
- jetty-10.0.9
- jetty-10.0.8
- jetty-10.0.7
- jetty-10.0.6
- jetty-10.0.5
- jetty-10.0.4
- jetty-10.0.3
- jetty-10.0.2
- jetty-10.0.1
- jetty-10.0.0
- jetty-10.0.0.beta3
- jetty-10.0.0.beta2
- jetty-10.0.0.beta1
- jetty-10.0.0.beta0
- jetty-10.0.0.alpha2
- jetty-10.0.0.alpha1
- jetty-10.0.0-alpha0
- jetty-9.4.57.v20241219
- jetty-9.4.56.v20240826
- jetty-9.4.55.v20240627
- jetty-9.4.54.v20240208
- jetty-9.4.53.v20231009
- jetty-9.4.52.v20230823
- jetty-9.4.51.v20230217
- jetty-9.4.50.v20221201
- jetty-9.4.50.v20221107
- jetty-9.4.49.v20220914
- jetty-9.4.48.v20220622
- jetty-9.4.47.v20220610
- jetty-9.4.46.v20220331
- jetty-9.4.45.v20220203
- jetty-9.4.44.v20210927
- jetty-9.4.43.v20210629
- jetty-9.4.42.v20210604
- jetty-9.4.41.v20210516
- jetty-9.4.40.v20210413
- jetty-9.4.39.v20210325
- jetty-9.4.38.v20210224
- jetty-9.4.37.v20210219
- jetty-9.4.36.v20210114
- jetty-9.4.35.v20201120
- jetty-9.4.34.v20201102
- jetty-9.4.33.v20201020
- jetty-9.4.32.v20200930
- jetty-9.4.31.v20200723
- jetty-9.4.30.v20200611
- jetty-9.4.29.v20200521
- jetty-9.4.28.v20200408
- jetty-9.4.27.v20200227
- jetty-9.4.26.v20200117
- jetty-9.4.25.v20191220
- jetty-9.4.24.v20191120
- jetty-9.4.23.v20191118
- jetty-9.4.22.v20191022
- jetty-9.4.21.v20190926
- jetty-9.4.20.v20190813
- jetty-9.4.19.v20190610
- jetty-9.4.18.v20190429
- jetty-9.4.17.v20190418
- jetty-9.4.16.v20190411
Showing
12 changed files
with
457 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
jetty-security/src/main/java/org/eclipse/jetty/security/LoggedOutAuthentication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995-2019 Mort Bay Consulting Pty. Ltd. | ||
// ------------------------------------------------------------------------ | ||
// All rights reserved. This program and the accompanying materials | ||
// are made available under the terms of the Eclipse Public License v1.0 | ||
// and Apache License v2.0 which accompanies this distribution. | ||
// | ||
// The Eclipse Public License is available at | ||
// http://www.eclipse.org/legal/epl-v10.html | ||
// | ||
// The Apache License v2.0 is available at | ||
// http://www.opensource.org/licenses/apache2.0.php | ||
// | ||
// You may elect to redistribute this code under either of these licenses. | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.security; | ||
|
||
import javax.servlet.ServletRequest; | ||
|
||
import org.eclipse.jetty.security.authentication.LoginAuthenticator; | ||
import org.eclipse.jetty.server.Authentication; | ||
import org.eclipse.jetty.server.UserIdentity; | ||
|
||
/** | ||
* LoggedOutAuthentication | ||
* | ||
* An Authentication indicating that a user has been previously, but is not currently logged in, | ||
* but may be capable of logging in after a call to Request.login(String,String) | ||
*/ | ||
public class LoggedOutAuthentication implements Authentication.NonAuthenticated | ||
{ | ||
private LoginAuthenticator _authenticator; | ||
|
||
public LoggedOutAuthentication (LoginAuthenticator authenticator) | ||
{ | ||
_authenticator = authenticator; | ||
} | ||
|
||
|
||
@Override | ||
public Authentication login(String username, Object password, ServletRequest request) | ||
{ | ||
if (username == null) | ||
return null; | ||
|
||
UserIdentity identity = _authenticator.login(username, password, request); | ||
if (identity != null) | ||
{ | ||
IdentityService identity_service = _authenticator.getLoginService().getIdentityService(); | ||
UserAuthentication authentication = new UserAuthentication("API",identity); | ||
if (identity_service != null) | ||
identity_service.associate(identity); | ||
return authentication; | ||
} | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters