mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-30 08:42:13 +00:00
Make OAuth2AuthorizedClient Serializable
Fixes gh-5757
This commit is contained in:
parent
2c078c5dd9
commit
e8d8eb59bf
@ -16,11 +16,14 @@
|
||||
package org.springframework.security.oauth2.client;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.security.core.SpringSecurityCoreVersion;
|
||||
import org.springframework.security.oauth2.client.registration.ClientRegistration;
|
||||
import org.springframework.security.oauth2.core.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.core.OAuth2RefreshToken;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* A representation of an OAuth 2.0 "Authorized Client".
|
||||
* <p>
|
||||
@ -37,7 +40,8 @@ import org.springframework.util.Assert;
|
||||
* @see OAuth2AccessToken
|
||||
* @see OAuth2RefreshToken
|
||||
*/
|
||||
public class OAuth2AuthorizedClient {
|
||||
public class OAuth2AuthorizedClient implements Serializable {
|
||||
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
|
||||
private final ClientRegistration clientRegistration;
|
||||
private final String principalName;
|
||||
private final OAuth2AccessToken accessToken;
|
||||
|
@ -15,12 +15,14 @@
|
||||
*/
|
||||
package org.springframework.security.oauth2.client.registration;
|
||||
|
||||
import org.springframework.security.core.SpringSecurityCoreVersion;
|
||||
import org.springframework.security.oauth2.core.AuthenticationMethod;
|
||||
import org.springframework.security.oauth2.core.AuthorizationGrantType;
|
||||
import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -36,7 +38,8 @@ import java.util.Set;
|
||||
* @since 5.0
|
||||
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc6749#section-2">Section 2 Client Registration</a>
|
||||
*/
|
||||
public final class ClientRegistration {
|
||||
public final class ClientRegistration implements Serializable {
|
||||
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
|
||||
private String registrationId;
|
||||
private String clientId;
|
||||
private String clientSecret;
|
||||
@ -150,7 +153,8 @@ public final class ClientRegistration {
|
||||
/**
|
||||
* Details of the Provider.
|
||||
*/
|
||||
public class ProviderDetails {
|
||||
public class ProviderDetails implements Serializable {
|
||||
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
|
||||
private String authorizationUri;
|
||||
private String tokenUri;
|
||||
private UserInfoEndpoint userInfoEndpoint = new UserInfoEndpoint();
|
||||
@ -209,7 +213,8 @@ public final class ClientRegistration {
|
||||
/**
|
||||
* Details of the UserInfo Endpoint.
|
||||
*/
|
||||
public class UserInfoEndpoint {
|
||||
public class UserInfoEndpoint implements Serializable {
|
||||
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
|
||||
private String uri;
|
||||
private AuthenticationMethod authenticationMethod = AuthenticationMethod.HEADER;
|
||||
private String userNameAttributeName;
|
||||
@ -261,7 +266,8 @@ public final class ClientRegistration {
|
||||
/**
|
||||
* A builder for {@link ClientRegistration}.
|
||||
*/
|
||||
public static class Builder {
|
||||
public static class Builder implements Serializable {
|
||||
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
|
||||
private String registrationId;
|
||||
private String clientId;
|
||||
private String clientSecret;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -15,8 +15,11 @@
|
||||
*/
|
||||
package org.springframework.security.oauth2.core;
|
||||
|
||||
import org.springframework.security.core.SpringSecurityCoreVersion;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* The authentication method used when authenticating the client with the authorization server.
|
||||
*
|
||||
@ -24,7 +27,8 @@ import org.springframework.util.Assert;
|
||||
* @since 5.0
|
||||
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc6749#section-2.3">Section 2.3 Client Authentication</a>
|
||||
*/
|
||||
public final class ClientAuthenticationMethod {
|
||||
public final class ClientAuthenticationMethod implements Serializable {
|
||||
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
|
||||
public static final ClientAuthenticationMethod BASIC = new ClientAuthenticationMethod("basic");
|
||||
public static final ClientAuthenticationMethod POST = new ClientAuthenticationMethod("post");
|
||||
private final String value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user