Move oidc package in oauth2-core and oauth2-client

Fixes gh-4710
This commit is contained in:
Joe Grandja 2017-10-26 20:32:45 -04:00
parent 86875e117b
commit 70543dcb30
23 changed files with 54 additions and 52 deletions

View File

@ -40,8 +40,8 @@ import org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationF
import org.springframework.security.oauth2.core.AccessToken; import org.springframework.security.oauth2.core.AccessToken;
import org.springframework.security.oauth2.core.endpoint.AuthorizationRequestUriBuilder; import org.springframework.security.oauth2.core.endpoint.AuthorizationRequestUriBuilder;
import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.security.oauth2.oidc.client.authentication.OidcAuthorizationCodeAuthenticationProvider; import org.springframework.security.oauth2.client.oidc.authentication.OidcAuthorizationCodeAuthenticationProvider;
import org.springframework.security.oauth2.oidc.client.userinfo.OidcUserService; import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService;
import org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter; import org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher;

View File

@ -19,7 +19,7 @@ import org.springframework.security.oauth2.client.registration.ClientRegistratio
import org.springframework.security.oauth2.client.registration.ClientRegistration.Builder; import org.springframework.security.oauth2.client.registration.ClientRegistration.Builder;
import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.security.oauth2.core.ClientAuthenticationMethod; import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
import org.springframework.security.oauth2.oidc.core.IdTokenClaim; import org.springframework.security.oauth2.core.oidc.IdTokenClaim;
/** /**
* Common OAuth2 Providers that can be used to create * Common OAuth2 Providers that can be used to create

View File

@ -20,7 +20,7 @@ import org.springframework.security.oauth2.client.registration.ClientRegistratio
import org.springframework.security.oauth2.client.registration.ClientRegistration.ProviderDetails; import org.springframework.security.oauth2.client.registration.ClientRegistration.ProviderDetails;
import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.security.oauth2.core.ClientAuthenticationMethod; import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
import org.springframework.security.oauth2.oidc.core.IdTokenClaim; import org.springframework.security.oauth2.core.oidc.IdTokenClaim;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;

View File

@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.client; package org.springframework.security.oauth2.client.oidc;
import org.springframework.security.oauth2.client.AuthorizedClient; import org.springframework.security.oauth2.client.AuthorizedClient;
import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.client.registration.ClientRegistration;
import org.springframework.security.oauth2.core.AccessToken; import org.springframework.security.oauth2.core.AccessToken;
import org.springframework.security.oauth2.oidc.core.IdToken; import org.springframework.security.oauth2.core.oidc.IdToken;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.client.authentication; package org.springframework.security.oauth2.client.oidc.authentication;
import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
@ -22,25 +22,25 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper;
import org.springframework.security.oauth2.client.authentication.AuthorizationCodeAuthenticationToken; import org.springframework.security.oauth2.client.authentication.AuthorizationCodeAuthenticationToken;
import org.springframework.security.oauth2.client.authentication.AuthorizationGrantTokenExchanger; import org.springframework.security.oauth2.client.authentication.AuthorizationGrantTokenExchanger;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken;
import org.springframework.security.oauth2.client.authentication.jwt.JwtDecoderRegistry; import org.springframework.security.oauth2.client.authentication.jwt.JwtDecoderRegistry;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService; import org.springframework.security.oauth2.client.oidc.OidcAuthorizedClient;
import org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService;
import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.client.registration.ClientRegistration;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
import org.springframework.security.oauth2.core.AccessToken; import org.springframework.security.oauth2.core.AccessToken;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.core.OAuth2Error; import org.springframework.security.oauth2.core.OAuth2Error;
import org.springframework.security.oauth2.core.endpoint.AuthorizationRequest; import org.springframework.security.oauth2.core.endpoint.AuthorizationRequest;
import org.springframework.security.oauth2.core.endpoint.AuthorizationResponse; import org.springframework.security.oauth2.core.endpoint.AuthorizationResponse;
import org.springframework.security.oauth2.core.endpoint.TokenResponse; import org.springframework.security.oauth2.core.endpoint.TokenResponse;
import org.springframework.security.oauth2.core.oidc.IdToken;
import org.springframework.security.oauth2.core.oidc.OidcScope;
import org.springframework.security.oauth2.core.oidc.endpoint.OidcParameter;
import org.springframework.security.oauth2.core.oidc.user.OidcUser;
import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.security.oauth2.jwt.JwtDecoder; import org.springframework.security.oauth2.jwt.JwtDecoder;
import org.springframework.security.oauth2.oidc.client.OidcAuthorizedClient;
import org.springframework.security.oauth2.oidc.client.userinfo.OidcUserService;
import org.springframework.security.oauth2.oidc.core.IdToken;
import org.springframework.security.oauth2.oidc.core.OidcScope;
import org.springframework.security.oauth2.oidc.core.endpoint.OidcParameter;
import org.springframework.security.oauth2.oidc.core.user.OidcUser;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;

View File

@ -13,22 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.client.userinfo; package org.springframework.security.oauth2.client.oidc.userinfo;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.oauth2.client.AuthorizedClient; import org.springframework.security.oauth2.client.AuthorizedClient;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException; import org.springframework.security.oauth2.client.oidc.OidcAuthorizedClient;
import org.springframework.security.oauth2.client.userinfo.NimbusUserInfoRetriever; import org.springframework.security.oauth2.client.userinfo.NimbusUserInfoRetriever;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService; import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
import org.springframework.security.oauth2.client.userinfo.UserInfoRetriever; import org.springframework.security.oauth2.client.userinfo.UserInfoRetriever;
import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.core.OAuth2Error; import org.springframework.security.oauth2.core.OAuth2Error;
import org.springframework.security.oauth2.core.oidc.OidcScope;
import org.springframework.security.oauth2.core.oidc.UserInfo;
import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser;
import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority;
import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.security.oauth2.oidc.client.OidcAuthorizedClient;
import org.springframework.security.oauth2.oidc.core.OidcScope;
import org.springframework.security.oauth2.oidc.core.UserInfo;
import org.springframework.security.oauth2.oidc.core.user.DefaultOidcUser;
import org.springframework.security.oauth2.oidc.core.user.OidcUserAuthority;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;

View File

@ -17,7 +17,7 @@ package org.springframework.security.oauth2.client.registration;
import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.security.oauth2.core.ClientAuthenticationMethod; import org.springframework.security.oauth2.core.ClientAuthenticationMethod;
import org.springframework.security.oauth2.oidc.core.OidcScope; import org.springframework.security.oauth2.core.oidc.OidcScope;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
/** /**
* The Address Claim represents a physical mailing address defined by the <i>OpenID Connect Core 1.0</i> specification * The Address Claim represents a physical mailing address defined by the <i>OpenID Connect Core 1.0</i> specification

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
import java.util.Map; import java.util.Map;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
import org.springframework.security.oauth2.core.AbstractOAuth2Token; import org.springframework.security.oauth2.core.AbstractOAuth2Token;
import org.springframework.util.Assert; import org.springframework.util.Assert;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
/** /**
* The &quot;Claims&quot; defined by the <i>OpenID Connect Core 1.0</i> specification * The &quot;Claims&quot; defined by the <i>OpenID Connect Core 1.0</i> specification

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
import org.springframework.security.oauth2.core.ClaimAccessor; import org.springframework.security.oauth2.core.ClaimAccessor;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
import org.springframework.security.oauth2.core.AccessToken; import org.springframework.security.oauth2.core.AccessToken;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
/** /**
* The &quot;Standard Claims&quot; defined by the <i>OpenID Connect Core 1.0</i> specification * The &quot;Standard Claims&quot; defined by the <i>OpenID Connect Core 1.0</i> specification

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
import org.springframework.security.oauth2.core.ClaimAccessor; import org.springframework.security.oauth2.core.ClaimAccessor;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;
import org.springframework.util.Assert; import org.springframework.util.Assert;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core.endpoint; package org.springframework.security.oauth2.core.oidc.endpoint;
/** /**
* Standard parameters defined in the OAuth Parameters Registry * Standard parameters defined in the OAuth Parameters Registry

View File

@ -16,4 +16,4 @@
/** /**
* Core classes and interfaces providing support for <i>OpenID Connect Core 1.0</i>. * Core classes and interfaces providing support for <i>OpenID Connect Core 1.0</i>.
*/ */
package org.springframework.security.oauth2.oidc.core; package org.springframework.security.oauth2.core.oidc;

View File

@ -14,13 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core.user; package org.springframework.security.oauth2.core.oidc.user;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.oauth2.core.oidc.user.OidcUser;
import org.springframework.security.oauth2.core.user.DefaultOAuth2User; import org.springframework.security.oauth2.core.user.DefaultOAuth2User;
import org.springframework.security.oauth2.oidc.core.IdToken; import org.springframework.security.oauth2.core.oidc.IdToken;
import org.springframework.security.oauth2.oidc.core.IdTokenClaim; import org.springframework.security.oauth2.core.oidc.IdTokenClaim;
import org.springframework.security.oauth2.oidc.core.UserInfo; import org.springframework.security.oauth2.core.oidc.UserInfo;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;

View File

@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core.user; package org.springframework.security.oauth2.core.oidc.user;
import org.springframework.security.core.AuthenticatedPrincipal; import org.springframework.security.core.AuthenticatedPrincipal;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.security.oauth2.oidc.core.IdToken; import org.springframework.security.oauth2.core.oidc.IdToken;
import org.springframework.security.oauth2.oidc.core.IdTokenClaimAccessor; import org.springframework.security.oauth2.core.oidc.IdTokenClaimAccessor;
import org.springframework.security.oauth2.oidc.core.StandardClaimAccessor; import org.springframework.security.oauth2.core.oidc.StandardClaimAccessor;
import org.springframework.security.oauth2.oidc.core.UserInfo; import org.springframework.security.oauth2.core.oidc.UserInfo;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.util.HashMap; import java.util.HashMap;

View File

@ -13,12 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core.user; package org.springframework.security.oauth2.core.oidc.user;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.oauth2.core.oidc.user.OidcUser;
import org.springframework.security.oauth2.core.user.OAuth2UserAuthority; import org.springframework.security.oauth2.core.user.OAuth2UserAuthority;
import org.springframework.security.oauth2.oidc.core.IdToken; import org.springframework.security.oauth2.core.oidc.IdToken;
import org.springframework.security.oauth2.oidc.core.UserInfo; import org.springframework.security.oauth2.core.oidc.UserInfo;
/** /**
* A {@link GrantedAuthority} that is associated with an {@link OidcUser}. * A {@link GrantedAuthority} that is associated with an {@link OidcUser}.

View File

@ -16,4 +16,4 @@
/** /**
* Provides a model for an <i>OpenID Connect Core 1.0</i> representation of a user <code>Principal</code>. * Provides a model for an <i>OpenID Connect Core 1.0</i> representation of a user <code>Principal</code>.
*/ */
package org.springframework.security.oauth2.oidc.core.user; package org.springframework.security.oauth2.core.oidc.user;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.security.oauth2.oidc.core.user; package org.springframework.security.oauth2.core.oidc.user;
import java.time.Instant; import java.time.Instant;
import java.util.Collections; import java.util.Collections;
@ -27,10 +27,10 @@ import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.oauth2.oidc.core.IdToken; import org.springframework.security.oauth2.core.oidc.IdToken;
import org.springframework.security.oauth2.oidc.core.IdTokenClaim; import org.springframework.security.oauth2.core.oidc.IdTokenClaim;
import org.springframework.security.oauth2.oidc.core.StandardClaim; import org.springframework.security.oauth2.core.oidc.StandardClaim;
import org.springframework.security.oauth2.oidc.core.UserInfo; import org.springframework.security.oauth2.core.oidc.UserInfo;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;