implement serializable for auth in cluster

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2019-09-10 10:21:38 +10:00
parent 9134def345
commit c67ac736df
4 changed files with 11 additions and 6 deletions

View File

@ -319,8 +319,7 @@ public class OpenIdAuthenticator extends LoginAuthenticator
if (authentication != null)
{
// Has authentication been revoked?
if (authentication instanceof Authentication.User &&
_loginService != null &&
if (authentication instanceof Authentication.User && _loginService != null &&
!_loginService.validate(((Authentication.User)authentication).getUserIdentity()))
{
LOG.debug("auth revoked {}", authentication);

View File

@ -19,6 +19,7 @@
package org.eclipse.jetty.security.openid;
import java.io.InputStream;
import java.io.Serializable;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
@ -35,10 +36,11 @@ import org.eclipse.jetty.util.log.Logger;
* This uses the OpenID Provider URL with the path {@link #CONFIG_PATH} to discover
* the required information about the OIDC service.
*/
public class OpenIdConfiguration
public class OpenIdConfiguration implements Serializable
{
private static final Logger LOG = Log.getLogger(OpenIdConfiguration.class);
private static String CONFIG_PATH = "/.well-known/openid-configuration";
private static final long serialVersionUID = 2227941990601349102L;
private static final String CONFIG_PATH = "/.well-known/openid-configuration";
private final String openIdProvider;
private final String issuer;

View File

@ -21,6 +21,7 @@ package org.eclipse.jetty.security.openid;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
@ -43,9 +44,10 @@ import org.eclipse.jetty.util.log.Logger;
* The response is then validated against the {@link OpenIdConfiguration}.
* </p>
*/
public class OpenIdCredentials
public class OpenIdCredentials implements Serializable
{
private static final Logger LOG = Log.getLogger(OpenIdCredentials.class);
private static final long serialVersionUID = 4766053233370044796L;
private final String redirectUri;
private final OpenIdConfiguration configuration;

View File

@ -18,10 +18,12 @@
package org.eclipse.jetty.security.openid;
import java.io.Serializable;
import java.security.Principal;
public class OpenIdUserPrincipal implements Principal
public class OpenIdUserPrincipal implements Principal, Serializable
{
private static final long serialVersionUID = 1521094652756670469L;
private final OpenIdCredentials _credentials;
public OpenIdUserPrincipal(OpenIdCredentials credentials)